Jump to content

displaying part of body as an acronym on a link, problems


echoninja

Recommended Posts

Ok at the moment I have a list of entries for articles, I want a quick preview when the person hovers over the link, this is the code I have at the moment

[code]$str=$a["body"];
              $newlength="60";              
              $a_body=substr($str, 0, $newlength);
              echo "&nbsp; ● <acronym title=". $a_body ."><a href=showarticle.php?id=". $id .">". $a_title ."</a></acronym> [posted ". $a_date ."]";[/code]

It works to an extent, it only displays the [b]first word[/b], what am I forgetting?

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.