mathewjenkinson Posted September 8, 2008 Share Posted September 8, 2008 Hi All, Im writing a page that displays snipets of news articles. I can get the page to connect to the MYSQL DB and get the title and thumbnail however I want to limit the amount of the actual news bit to 50 characters with a link to the rest of the article. Anyone got any ideas? Thanks Mathew. Link to comment https://forums.phpfreaks.com/topic/123284-limiting-the-ammount-of-text-displayed/ Share on other sites More sharing options...
discomatt Posted September 8, 2008 Share Posted September 8, 2008 echo ( strlen($str)<55 ? $str : substr($str, 0, 50).'...' ); Link to comment https://forums.phpfreaks.com/topic/123284-limiting-the-ammount-of-text-displayed/#findComment-636706 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.