yahn Posted July 4, 2006 Share Posted July 4, 2006 I'm using ajax and I want to send a javascript function as text so I don't have to load every function I need in the aplication from the start. But I don't know how to actually put brackets and semicolons in a string. So if I wanted turn a simple [code=php:0]function foo() { alert('bar'); }[/code] into a string so I could send it as text how would I do that? Thank you for your time. Quote Link to comment https://forums.phpfreaks.com/topic/13668-php-string-with-brackets-and-semicolons-in-it-really/ Share on other sites More sharing options...
SharkBait Posted July 4, 2006 Share Posted July 4, 2006 If you need to escape the characters put a \ in front of them :)so[code]<?phpecho "This is \"MyText\" and this is how I want it to look.";?>[/code]Comes out like:This is "My Text" and this is how I want it to look. Quote Link to comment https://forums.phpfreaks.com/topic/13668-php-string-with-brackets-and-semicolons-in-it-really/#findComment-53008 Share on other sites More sharing options...
yahn Posted July 4, 2006 Author Share Posted July 4, 2006 Ahh. It's been too long since I've been working with mysql. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/13668-php-string-with-brackets-and-semicolons-in-it-really/#findComment-53012 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.