I am using this to shorten long titles:
The thing is it shortens them this way:Code:<?php $title = $row['adtitle']; if (strlen($title) > 50) { $title = substr($title, 0, 50).'...'; } echo $title; ?>
Selling housing in OH. Stop by to check it ou...
Make money working from home. Best opport...
I want it to shorten them right before the last word, so that it would look like this:
Selling housing in OH. Stop by to check it...
Make money working from home. Best...
Any ideas how to do that?
Thanks!



Reply With Quote


Bookmarks