note 104960 deleted from function.wordwrap by danbrown

From: Date: Tue, 19 Jul 2011 15:52:08 +0000
Subject: note 104960 deleted from function.wordwrap by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181705@lists.php.net to get a copy of this message
Note Submitter: perrycs at msn dot com ---- I notice a lot of people writing functions below to split long non broken words like ahahahahahahahahahahahaha and I didn't see anyone mention one of the built in parts to this function called CUT! (from the main article at the top) If the cut is set to TRUE, the string is always wrapped at or before the specified width. So if you have a word that is larger than the given width, it is broken apart. (See second example). <?php $text = "A very long woooooooooooord."; $newtext = wordwrap($text, 8, "\n", true); echo "$newtext\n"; ?> Produces: A very long wooooooo ooooord. Just thought I would re-point that out since no-one seems to be using it... just writing their own routines to do something built in. Maybe I'm missing something, I'm still kinda new to PHP (so far I love it).

« previous php.notes (#181705) next »