This example describes how PHP uses WordWrap to format text paragraphs. Share to everyone for your reference. The specific analysis is as follows:
The WordWrap () function formats text paragraphs by the specified fixed line length to make paragraphs look more neat
<?php
$string = "TRADING on MARGIN poses ADDITIONAL risks and are not
suitable to all
investors.
A COMPLETE LIST of the risks associated with MARGIN TRADING are AVAILABLE in the MARGIN RISK disclosure
DOCUMENT. ";
$string = str_replace ("\ n", "", $string)
; $string = Str_replace ("\ R", "", $string);
Print (WordWrap ($string, 40). " \ n ");
? >
The code above returns the following results
TRADING on MARGIN poses ADDITIONAL risks and isn't suitable for all
investors. A COMPLETE LIST of the
risks associated with MARGIN TRADING are
AVAILABLE in the MARGIN RISK disclosure
docu ment.
I hope this article will help you with your PHP program design.