note 70179 added to function.wordwrap
| From: | rorith at kydance dot net | Date: | Thu, 05 Oct 2006 21:42:23 +0000 |
| Subject: | note 70179 added to function.wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118108@lists.php.net to get a copy of this message | ||
Re: egyptechno [at] gmail.com:
Uh... wow. Nice try, but you're doing a lot more work than necessary. Try this:
<?php
function wordCut($text, $limit, $msg) {
if (strlen($text) > $limit) {
$ourTxt = substr($text, 0, $limit);
$finalTxt = $ourTxt.$msg;
} else {
$finalTxt = $text;
}
return $finalTxt;
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 70.96.176.13
----
Manual Page -- http://www.php.net/manual/en/function.wordwrap.php
Edit -- https://master.php.net/note/edit/70179
Del: integrated -- https://master.php.net/note/delete/70179/integrated
Del: useless -- https://master.php.net/note/delete/70179/useless
Del: bad code -- https://master.php.net/note/delete/70179/bad+code
Del: spam -- https://master.php.net/note/delete/70179/spam
Del: non-english -- https://master.php.net/note/delete/70179/non-english
Del: in docs -- https://master.php.net/note/delete/70179/in+docs
Del: other reasons-- https://master.php.net/note/delete/70179
Reject -- https://master.php.net/note/reject/70179
Search -- https://master.php.net/manage/user-notes.php