Jump to content

$title on multi lines<li>


swampone

Recommended Posts

l have a video site, and each title is generated dynamically on a <li>. The problem is  some titles are longer than others and spill on to the next <li> throwing my site all off. What i need to do is designate 2 lines for the titles just in case the title is too long.

 

<ul>
    <li><?php echo $title; ?></li>
    <li>///continue $title or add blank line so it doesn't throw everything off</li>
</ul>

Link to comment
https://forums.phpfreaks.com/topic/209621-title-on-multi-lines/
Share on other sites

Consider

 

I'm thinking the easiest thing would be to concatenate 'Pros: ' to the rest of the string.

 

$string = 'Pros: ';
string .= $row_site_list['pros'];
echo wordwrap($string, 70, '<br />', true)

 

taken from this posts solution

http://www.phpfreaks.com/forums/index.php/topic,306219.0.html I think that will help in one form way shape or another. Or you can just limit the amount of characters on the line to be displayed.

 

Like mentioned here:

http://monkeytooth.net/2010/06/php-shorten-strin/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.