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
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/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.