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? Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 18, 2008 Share Posted June 18, 2008 with trim() Quote Link to comment 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... Quote Link to comment Share on other sites More sharing options...
corbin Posted June 18, 2008 Share Posted June 18, 2008 http://php.net/substr Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 18, 2008 Share Posted June 18, 2008 substr Quote Link to comment 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.