note 72504 deleted from function.split by didou

From: Date: Mon, 22 Jan 2007 07:37:45 +0000
Subject: note 72504 deleted from function.split by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-122027@lists.php.net to get a copy of this message
Note Submitter: hansvane at yahoo dot com dot ar ---- 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

« previous php.notes (#122027) next »