I insert some text contain [
(only one parentheses, not include ]
), then when I use mysql query to the front php page, the [
will damage html css format.
$result = mysql_query("SELECT * FROM mytable Order By date DESC LIMIT 10");
while ($row = mysql_fetch_array($result))
{
echo '<div class="text">'.$row['content'].'</div>';
}
I notice the html output source code.
before the [
text, the html is correct,
<div class="text">this is a test, no parentheses</div>
but after [
text, the html looks as
<div class=”text”>this is a test, contain [ </div>
How many symbols will cause the faults like this? and how to avoid? Thanks.