html - PHP: Trouble composing strings -
i'm using php code
echo " onclick='myfunction(" . $row['username'] . ")'"
that give me result
onclick="myfunction(francis88)"
but want this:
onclick="myfunction('francis88')"
how should change php code obtain this?
use \
escape character within string, example:
echo " onclick=\"myfunction('" . $row['username'] . "')\""
Comments
Post a Comment