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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -