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 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; 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
Archived
This topic is now archived and is closed to further replies.