Jump to content

Apostrophe Confusion


galvin

Recommended Posts

I have code where info I save to echo later is all within double quotes. So for any other quotes inside the double quotes, I use single quotes. But I am running into trouble when I have even more nested single quotes inside single quotes.

 

Here is the code and it's not working because the single quotes around ARE YOUR SURE are nested within the single quotes for onclick. If I change either set to double quotes, it obviously doesn't work. So what is the proper way to handle this?

 

$codetoecholater = "<a href='something.php' onclick='return confirm('Are you sure?')'>Delete</a>";

Link to comment
https://forums.phpfreaks.com/topic/270516-apostrophe-confusion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.