note 72504 added to function.split
| From: | hansvane at yahoo dot com dot ar | Date: | Mon, 22 Jan 2007 06:09:01 +0000 |
| Subject: | note 72504 added to function.split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122023@lists.php.net to get a copy of this message | ||
This function is very simple and many other functions make this on PHP 5 and even some ones in 4 the
good think about this one is that work on php 3.0.6 and 4
function split_hjms_chars($xstr, $xlenint, $xlaststr)
{
$texttoshow = chunk_split($xstr,$xlenint,"\r\n");
$texttoshow = split("\r\n",$texttoshow);
$texttoshow = $texttoshow[0].$xlaststr;
return $texttoshow;
}
// For use
echo split_hjms_chars("This is your text",6,"...");
// Will return
This i...
It is useful to cut long text on preview lists and if the server it's old.
Hope it helps some one. Hans Svane
----
Server IP: 200.59.45.3
Probable Submitter: 200.117.187.191
----
Manual Page -- http://www.php.net/manual/en/function.split.php
Edit -- https://master.php.net/note/edit/72504
Del: integrated -- https://master.php.net/note/delete/72504/integrated
Del: useless -- https://master.php.net/note/delete/72504/useless
Del: bad code -- https://master.php.net/note/delete/72504/bad+code
Del: spam -- https://master.php.net/note/delete/72504/spam
Del: non-english -- https://master.php.net/note/delete/72504/non-english
Del: in docs -- https://master.php.net/note/delete/72504/in+docs
Del: other reasons-- https://master.php.net/note/delete/72504
Reject -- https://master.php.net/note/reject/72504
Search -- https://master.php.net/manage/user-notes.php