Search code examples
phphtmltooltip

Tooltip text not working properly


I am using tooltip inside of an echo statement i.e.

echo "<div id='image' data-toggle='tooltip' title=".$row['displayname'].">"; 

but it only displays the first word.

suppose the $row['displayname'] returns "here is the code" then on hover it only displays "here".

So any help Thankyou..


Solution

  • Try wrapping your title in '' quotes.

    echo "<div id='image' data-toggle='tooltip' title='".$row['displayname']."'>";