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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

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