vicodin Posted July 20, 2008 Share Posted July 20, 2008 Hey guys i am drawing a blank right now how would i cut the rest of the text off in a string at lets say the 200th character? Link to comment https://forums.phpfreaks.com/topic/115721-cut-off-text-at-designated-character-amount/ Share on other sites More sharing options...
papaface Posted July 20, 2008 Share Posted July 20, 2008 <?php $cut = substr("somthing200charslong",0,200); echo $cut; ?> Link to comment https://forums.phpfreaks.com/topic/115721-cut-off-text-at-designated-character-amount/#findComment-594915 Share on other sites More sharing options...
paul2463 Posted July 20, 2008 Share Posted July 20, 2008 $newstring = substr($oldstring,0, 200); Link to comment https://forums.phpfreaks.com/topic/115721-cut-off-text-at-designated-character-amount/#findComment-594916 Share on other sites More sharing options...
papaface Posted July 20, 2008 Share Posted July 20, 2008 $newstring = substr($oldstring,0, 200); That won't work as it counts from the end. Link to comment https://forums.phpfreaks.com/topic/115721-cut-off-text-at-designated-character-amount/#findComment-594919 Share on other sites More sharing options...
vicodin Posted July 20, 2008 Author Share Posted July 20, 2008 Thank you guys! Link to comment https://forums.phpfreaks.com/topic/115721-cut-off-text-at-designated-character-amount/#findComment-594922 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.