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

Popular posts from this blog

objective c - Can't build GCM with Protobuf in Xcode -

embed HTML within ASP.net -

javascript - jQuery iScroll clickable list elements while retaining scroll? -