This article mainly introduces how to format text paragraphs using wordwrap in php. it involves the skills of using the wordwrap function and has some reference value, for more information about how to format text paragraphs by using wordwrap in php, see the following example. Share it with you for your reference. The specific analysis is as follows:
The wordwrap () function can format text paragraphs based on the specified fixed line length to make the paragraphs look more neat.
<? Php $ string = "trading on margin poses additionalrisks and is not suitable for all investors. a complete list of the risks associated with margin trading isavailable in the margin risk disclosure document. "; $ string = str_replace (" \ n "," ", $ string); $ string = str_replace (" \ r "," ", $ string ); print (wordwrap ($ string, 40 ). "\ n");?>
The above code returns the following results:
Trading on margin poses additionalrisks and is not suitable for allinvestors. a complete list of therisks associated with margin trading isavailable in the margin risk disclosuredocument.
I hope this article will help you with php programming.