Notoriouswow Posted July 18, 2010 Share Posted July 18, 2010 Hello phpfreaks, I have a self coded forums (Yes, it is mine, it is not 3rd party) Would like to know how I would make it so that after a certain amount of characters a topic would stop and end in '...' without the quotes obviously. If you need the code, just ask. Thanks in Advance, NotoriousWoW Link to comment https://forums.phpfreaks.com/topic/208092-help-after-so-many-character-end-in/ Share on other sites More sharing options...
Mchl Posted July 18, 2010 Share Posted July 18, 2010 $maxLen = 85; if(strlen($topic) > $maxLen) { $topic = substr($topic,0,$maxLen-3).'...'; } echo $topic Link to comment https://forums.phpfreaks.com/topic/208092-help-after-so-many-character-end-in/#findComment-1087759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.