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; } Quote 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 Quote 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); Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.