note 77814 added to function.mb-strimwidth
| From: | josiah dot ritchie at gmail dot com | Date: | Thu, 13 Sep 2007 18:48:45 +0000 |
| Subject: | note 77814 added to function.mb-strimwidth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130482@lists.php.net to get a copy of this message | ||
While having the option to append a string to the end is nice, you can run into the problem of
having a space between the append if the width is truncated after a space. I find something like
this to be more attractive in the output, although messy in the code.
rtrim(mb_strimwidth($string, 0, 24))."..."
----
Server IP: 208.69.120.35
Probable Submitter: 207.172.227.59
----
Manual Page -- http://www.php.net/manual/en/function.mb-strimwidth.php
Edit -- https://master.php.net/note/edit/77814
Del: integrated -- https://master.php.net/note/delete/77814/integrated
Del: useless -- https://master.php.net/note/delete/77814/useless
Del: bad code -- https://master.php.net/note/delete/77814/bad+code
Del: spam -- https://master.php.net/note/delete/77814/spam
Del: non-english -- https://master.php.net/note/delete/77814/non-english
Del: in docs -- https://master.php.net/note/delete/77814/in+docs
Del: other reasons-- https://master.php.net/note/delete/77814
Reject -- https://master.php.net/note/reject/77814
Search -- https://master.php.net/manage/user-notes.php