For those who don't know, I was one of you till about a month ago, you can have PHP write double quotes into your html. You just need a slash in front of each " to keep it part of the string.
$mydiv = "<div class=\"myclass\"></div>";
echo $mydiv;
//<div class="myclass"></div>
This is really handy if you need to pass stuff to a javascript function.
$PassThis = "Passed";
$btn = "<button class='btn' onclick=\"MyFun('$PassThis')\">My Button</button>";
This comment has been removed by a blog administrator.
ReplyDelete