How can I change my code to show "" and not '' in a echo?

57 views Asked by At

How can I change this code:

echo "<button onclick='document.location='TEST1.php?auteurnr=$row[0]''> $row[voornaam] $row[achternaam]</button>";

Into showing this:

<button onclick="document.location='test1.php?auteurnr=61'">

And not this:

<button onclick='document.location='TEST1.php?auteurnr=61''>
1

There are 1 answers

1
Paladin On BEST ANSWER

You mean character escaping?

echo "<button onclick=\"document.location='TEST1.php?auteurnr=$row[0]'\"> $row[voornaam] $row[achternaam]</button>";