Guest kilbad Posted April 28, 2007 Share Posted April 28, 2007 If I have a variable, $text = "some text here.. goes on for a while.."; How can I grab the first 160 characters of the text in that variable and put it into another, new variable? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/49049-how-to-grab-first-160-characters-of-variable/ Share on other sites More sharing options...
heckenschutze Posted April 28, 2007 Share Posted April 28, 2007 Well thats easy... $text = "some text here.. goes on for a while.."; $first160 = substr($text, 0, 160) Hope that helps! Link to comment https://forums.phpfreaks.com/topic/49049-how-to-grab-first-160-characters-of-variable/#findComment-240320 Share on other sites More sharing options...
Guest kilbad Posted April 28, 2007 Share Posted April 28, 2007 thank you so much! Link to comment https://forums.phpfreaks.com/topic/49049-how-to-grab-first-160-characters-of-variable/#findComment-240321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.