DrTrans Posted November 18, 2011 Share Posted November 18, 2011 $text = "this is a lot of effing text" what i want to do is limit it to the 10 characters so it gives back $stext = substr($text, 10); <-- this is how i thought it would work echo " $stext"; Quote Link to comment https://forums.phpfreaks.com/topic/251358-limiting-the-amount-of-returned-characters-from-variable/ Share on other sites More sharing options...
xyph Posted November 18, 2011 Share Posted November 18, 2011 Check out substr in the manual. Note the order of the arguments. Quote Link to comment https://forums.phpfreaks.com/topic/251358-limiting-the-amount-of-returned-characters-from-variable/#findComment-1289207 Share on other sites More sharing options...
DrTrans Posted November 18, 2011 Author Share Posted November 18, 2011 Thanks mate, forgot to see that u had to make a start position Quote Link to comment https://forums.phpfreaks.com/topic/251358-limiting-the-amount-of-returned-characters-from-variable/#findComment-1289208 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.