DrTrans Posted November 18, 2011 Share Posted November 18, 2011 What I'm trying to do is this: $text = "this is just a bunch of random text"; $stext = "substr('$text', 10); echo " $stext"; i want $stext to only give me the first 10 characters of the original string. I dont know if the substr function would do this trick? any assistance I'm sure its simple Quote Link to comment https://forums.phpfreaks.com/topic/251356-limiting-the-size-of-variable-responce/ Share on other sites More sharing options...
trq Posted November 18, 2011 Share Posted November 18, 2011 You have misplaced quotes all over the place. $text = "this is just a bunch of random text"; $stext = substr($text, 0, 10); echo $stext; Quote Link to comment https://forums.phpfreaks.com/topic/251356-limiting-the-size-of-variable-responce/#findComment-1289236 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.