joemamahunt Posted April 8, 2007 Share Posted April 8, 2007 Hello, I ran into this error and can't seem to think of a way out of it. This may be dumb to ask, but this is my first time running into this. For example, something like this: echo '<a href="javascript:popup('file.php');">click here</a>'; It obviously gives me the error: unexpected T_STRING, expecting ',' or ';' Because the single quotation is being used twice. How can I use that code without errors? Is there a third quotation I don't know about? Link to comment https://forums.phpfreaks.com/topic/46075-both-quotations-used-in-code-but-need-to-quote-again/ Share on other sites More sharing options...
emehrkay Posted April 8, 2007 Share Posted April 8, 2007 escape the single quotes in the function call popup(\'file.php\')... Link to comment https://forums.phpfreaks.com/topic/46075-both-quotations-used-in-code-but-need-to-quote-again/#findComment-223898 Share on other sites More sharing options...
joemamahunt Posted April 8, 2007 Author Share Posted April 8, 2007 Whoa, fast reply. Thanks! Works. Link to comment https://forums.phpfreaks.com/topic/46075-both-quotations-used-in-code-but-need-to-quote-again/#findComment-223900 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.