dreamwest Posted February 8, 2009 Share Posted February 8, 2009 How can i trunicate a string? Link to comment https://forums.phpfreaks.com/topic/144298-trunicate-string/ Share on other sites More sharing options...
mister5317 Posted February 8, 2009 Share Posted February 8, 2009 <?php $string = 'The quick brown fox jumped over the lazy dog.'; echo substr($string, 0, 25); // 'The quick brown fox jumpe' ?> The last parameter, 25, is the number of characters to print. See http://us2.php.net/substr for more information. Link to comment https://forums.phpfreaks.com/topic/144298-trunicate-string/#findComment-757260 Share on other sites More sharing options...
dreamwest Posted February 8, 2009 Author Share Posted February 8, 2009 Thanks Link to comment https://forums.phpfreaks.com/topic/144298-trunicate-string/#findComment-757269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.