phpSensei Posted July 30, 2007 Share Posted July 30, 2007 I am creating a simple function that gets a text that has the strlen (string length) longer than 300 chars, and cuts it down to 100 hundred then adds three "...", and I know what to do from there on.. What function cuts down a string at a single char number...? Link to comment https://forums.phpfreaks.com/topic/62548-a-line-number/ Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 http://www.php.net/substr Link to comment https://forums.phpfreaks.com/topic/62548-a-line-number/#findComment-311311 Share on other sites More sharing options...
Asperon Posted July 30, 2007 Share Posted July 30, 2007 well the str_split() function can do the following <?php $str = "Hello Friend"; $arr1 = str_split($str); $arr2 = str_split($str, 3); print_r($arr1); // every index is a letter $arr1(0) is 'H' $arr1(1) is 'e' etc print_r($arr2); //takes every 3 letters $arr1(0) is 'Hel' $arr1(1) is 'lo ' etc ?> Link to comment https://forums.phpfreaks.com/topic/62548-a-line-number/#findComment-311313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.