spent all levels of ' " and \"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
janper
Forum Newbie
Posts: 6
Joined: Wed Jun 02, 2010 5:55 pm

spent all levels of ' " and \"

Post by janper »

hello.
a stupid question - i need to echo this in PHP:

onclick='javascript: document.getElementById("k10").innerHTML ="<iframe src =\"./new.php?subfolder=projects&level=1\" ></iframe>";'

but i already used both ' and " with \" for the javascript, so i don't know how to write the quotes to make sure i'll post exactly this into the page.

thanks!
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: spent all levels of ' " and \"

Post by Weirdan »

Code: Select all

<?php
//some php code 
?>onclick='javascript:document.getElementById("k10").innerHTML ="<iframe src =\"./new.php?subfolder=projects&level=1\" ></iframe>";'<?php
// some php code
janper
Forum Newbie
Posts: 6
Joined: Wed Jun 02, 2010 5:55 pm

Re: spent all levels of ' " and \"

Post by janper »

i see

will it work when it's inside of a php function? i actually also need to use a variables for ?subfolder=projects&level=1
janper
Forum Newbie
Posts: 6
Joined: Wed Jun 02, 2010 5:55 pm

Re: spent all levels of ' " and \"

Post by janper »

great! it does work!

i really have learned something now ;) thanks
Post Reply