Taxa Posted June 18, 2008 Share Posted June 18, 2008 Lets say, I have a string with 600 characters, how would I retrieve only 300 of the characters? I don't want to remove the other 300, I just want to output (with echo) the first 300 characters of the string. Is there a php function that does this? Link to comment https://forums.phpfreaks.com/topic/110700-trimming-a-string/ Share on other sites More sharing options...
Jabop Posted June 18, 2008 Share Posted June 18, 2008 with trim() Link to comment https://forums.phpfreaks.com/topic/110700-trimming-a-string/#findComment-567942 Share on other sites More sharing options...
Taxa Posted June 18, 2008 Author Share Posted June 18, 2008 that doesn't achieve this, that removes specified characters, not shorten a variable... Link to comment https://forums.phpfreaks.com/topic/110700-trimming-a-string/#findComment-567947 Share on other sites More sharing options...
corbin Posted June 18, 2008 Share Posted June 18, 2008 http://php.net/substr Link to comment https://forums.phpfreaks.com/topic/110700-trimming-a-string/#findComment-567948 Share on other sites More sharing options...
Jabop Posted June 18, 2008 Share Posted June 18, 2008 substr Link to comment https://forums.phpfreaks.com/topic/110700-trimming-a-string/#findComment-567949 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.