lilwing Posted August 22, 2007 Share Posted August 22, 2007 just curious.. plesae give me an example of what line 7 would look like $string= results; $cutoff = strlen($string); if($cutoff=>500) { echo first500chars; //waht would this be? echo "... <br /><br /> <a href="page.php?storyid=something">Click here to read more</a> } else { echo $string; } Link to comment https://forums.phpfreaks.com/topic/66166-solved-click-here-to-read-more/ Share on other sites More sharing options...
AndyB Posted August 22, 2007 Share Posted August 22, 2007 substr() is the function you want - http://www.php.net/manual/en/function.substr.php Link to comment https://forums.phpfreaks.com/topic/66166-solved-click-here-to-read-more/#findComment-330956 Share on other sites More sharing options...
thryb Posted August 22, 2007 Share Posted August 22, 2007 echo substr($yourstring, 0, 500); Link to comment https://forums.phpfreaks.com/topic/66166-solved-click-here-to-read-more/#findComment-330957 Share on other sites More sharing options...
lilwing Posted August 22, 2007 Author Share Posted August 22, 2007 thanks guys Link to comment https://forums.phpfreaks.com/topic/66166-solved-click-here-to-read-more/#findComment-330958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.