Wrapping Text

Author Topic: Wrapping Text  (Read 1364 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
Wrapping Text
« on: 12-19-2015, 02:51:59 »
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


Related Topics

  Subject / Started by Replies Last post
Anchor Text

Started by oleshka « 1 2 » SEO Basics

16 Replies
Last post 08-14-2016, 04:24:44
by mamxanhcn
2 Replies
Last post 06-29-2011, 14:53:14
by zoesmith01
0 Replies
Last post 09-06-2011, 03:41:48
by Walalayo
0 Replies
Last post 09-06-2011, 03:44:27
by Walalayo
0 Replies
Last post 10-17-2014, 18:37:25
by chr2014