Jump to content

Archived

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

echoninja

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

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?

Share this post


Link to post
Share on other sites
forgot to put the \ before and after "
try this

[code]
echo "&nbsp; ● <acronym title=\"". $a_body ."\"><a href=showarticle.php?id=". $id .">". $a_title ."</a></acronym> [posted ". $a_date ."]";?>
[/code]

Share this post


Link to post
Share on other sites

×

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.