violinrocker Posted September 5, 2009 Share Posted September 5, 2009 if i have in my fetched row "A summary or recap is a shortened version of the original. The main purpose of such a simplification is to highlight the major points from the original (much longer) subject, e.g. a text, a film or an event. The target is to help the audience get the gist in a short period of time." how do i limit the letters so that it would look like"A summary or recap is a shortened version of the original. The main purpose of such a simplification is to highlight the major points from the original..." Quote Link to comment https://forums.phpfreaks.com/topic/173199-limit-letters-of-fetched-rows/ Share on other sites More sharing options...
bundyxc Posted September 5, 2009 Share Posted September 5, 2009 So, you want to show the first 151 characters, then add and ellipsis? $haystack= "A summary or recap is a shortened version of the original. The main purpose of such a simplification is to highlight the major points from the original (much longer) subject, e.g. a text, a film or an event. The target is to help the audience get the gist in a short period of time."; $needle = substr($haystack, 0, 151); $newString = $needle . '...'; print($newString); Quote Link to comment https://forums.phpfreaks.com/topic/173199-limit-letters-of-fetched-rows/#findComment-912983 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.