note 105921 deleted from function.wordwrap by peehaa
| From: | peehaa@php.net | Date: | Thu, 09 Mar 2017 09:09:51 +0000 |
| Subject: | note 105921 deleted from function.wordwrap by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208874@lists.php.net to get a copy of this message | ||
Note Submitter: paul at preinheimer dot com
----
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.