If you like SEOmastering Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Wrapping Text

Started by chinmay.sahoo, 12-19-2015, 02:51:59

Previous topic - Next topic

chinmay.sahooTopic starter

Sometimes it is helpful to be able to display a line of text in the user's web browser so that it fi ts neatly into a column of width no more than a specifi ed number of characters.

The wordwrap function takes three arguments: a string, a number and another string. If variable $str has the value "The time has come, the Walrus said, to talk of many things" the function call wordwrap($str,15,"<br>") will return a string broken up every 15 characters at most by the replacement of a space character by the separator "<br>". For this example the string returned will be "The time has <br> come, the <br> Walrus said, to <br> talk of many <br> things". The reason why "<br>" was chosen as the separator was that when output in a web browser this string is displayed in 'word wrapped' form as



If you like SEOmastering Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...