Just wondering, what is the correc开发者_开发技巧t way to add HTML <strong>
tags or anything else for that matter to this?
echo $row->title
I did this
echo '<strong>'.$row->title.'</strong>';
The way you are doing it is perfectly fine. However, don't forget that you might need to escape html characters unless HTML should be allowed (which is unlikely in a "title").
echo '<strong>'.htmlspecialchars($row->title).'</strong>';
This would escape <> and some other special characters.
There is no wrong or correct way to do it. Do it like it is best readable for you (and this is a subjective question). But try to develop a standard and don't do it in a different way everytime.
you can also do this
echo "<strong>{$row->title}</strong>";
精彩评论