Php uses wordwrap to format text paragraphs. Php uses wordwrap to format text paragraphs. This article mainly introduces how php uses wordwrap to format text paragraphs. it involves the use of wordwrap functions, some reference methods for formatting text paragraphs using wordwrap in php
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, see
This example describes how php uses wordwrap to format text paragraphs. 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.
?
1 2 3 4 5 6 7 8 9 10 |
$ String = "TRADING ON MARGIN POSES ADDITIONAL RISKS AND IS NOT SUITABLE FOR ALL INVESTORS. A COMPLETE LIST OF THE RISKS ASSOCIATED WITH MARGIN TRADING IS Available 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:
?
1 2 3 4 5 6 |
TRADING ON MARGIN POSES ADDITIONAL RISKS AND IS NOT SUITABLE FOR ALL INVESTORS. A COMPLETE LIST OF RISKS ASSOCIATED WITH MARGIN TRADING IS AVAILABLE IN THE MARGIN RISK DISCLOSURE DOCUMENT. |
I hope this article will help you with php programming.
This article describes how to format text paragraphs using wordwrap in php. it involves the use of the wordwrap function and provides some reference...