efficacious Posted May 16, 2011 Share Posted May 16, 2011 I made a template class recently and the only problem I'm having with it is that when I pull the HTML through if I add double quotes anywhere it breaks the code. I understand why its breaking sorta but I can't figure out how to fix it. <html> <head> </head> <body> <p id='Element'>"Something in quotes"</p> </body> </html> $string = $template->myMethod();//Returns the html in a string eval("\$HTML = \"$string\";"); //The error happens during the evaluation here echo($HTML); The string breaks with double quotes during the eval method and I've tried replacing the " mark with \" by using str_replace but i haven't been able to get it to work. Thanks for your replies Link to comment https://forums.phpfreaks.com/topic/236591-quotation-mark-issue/ Share on other sites More sharing options...
efficacious Posted May 16, 2011 Author Share Posted May 16, 2011 nvm I figured out the problem.. I had some stray " marks in the html that were pre-escaped and when I was programmatically escaping them it broke the code. Its all worked out now Link to comment https://forums.phpfreaks.com/topic/236591-quotation-mark-issue/#findComment-1216283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.