note 105921 added to function.wordwrap
| From: | paul at preinheimer dot com | Date: | Sun, 25 Sep 2011 23:04:03 +0000 |
| Subject: | note 105921 added to function.wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183423@lists.php.net to get a copy of this message | ||
If your goal is to allow a browser to word-wrap nicely, while maintaining a fluid layout,
you'll want to break with: ​
It's a zero width space character: http://en.wikipedia.org/wiki/Zero-width_space
This way the browser can break where it needs to, without adding a visual distraction of spaces
within the text.
e.g.
<?php
//Using ​ here allows the browser to break the line of text, without the visual
distraction.
$line = wordwrap($line, 10, "​", true);
?>
#PROTIP: leave a comment, so the next person to read your code has a clue what you've done.
----
Server IP: 69.147.83.197
Probable Submitter: 173.177.236.114
----
Manual Page -- http://www.php.net/manual/en/function.wordwrap.php
Edit -- https://master.php.net/note/edit/105921
Del: integrated -- https://master.php.net/note/delete/105921/integrated
Del: useless -- https://master.php.net/note/delete/105921/useless
Del: bad code -- https://master.php.net/note/delete/105921/bad+code
Del: spam -- https://master.php.net/note/delete/105921/spam
Del: non-english -- https://master.php.net/note/delete/105921/non-english
Del: in docs -- https://master.php.net/note/delete/105921/in+docs
Del: other reasons-- https://master.php.net/note/delete/105921
Reject -- https://master.php.net/note/reject/105921
Search -- https://master.php.net/manage/user-notes.php