dreamwest Posted February 8, 2009 Share Posted February 8, 2009 How can i trunicate a string? Quote 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. Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/144298-trunicate-string/#findComment-757269 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.