Sunday, August 18, 2013

Echo HTML tags with attributes

Echo HTML tags with attributes

This code is fine :
<?php
echo "<div>Hello world!</div>";
?>
This code produces an error :
<?php
echo "<div id="test">Hello world!</div>";
?>
It says
Parse error: syntax error, unexpected 'test' (T_STRING), expecting ',' or ';'
Why is that?

No comments:

Post a Comment