Gossamer Forum
Home : General : Internet Technologies :

Better than <<HTML or " ???

Quote Reply
Better than <<HTML or " ???
Does anyone know of a better way to quote strings, without having to escape charachters? (this is PHP) I.e.

$var = "something but \" need to be escaped...which is a pain";

and

$var = <<<HTML
Again, here I can use " without a problem, but I have to make sure the ending quote for this script does NOT have any leading spaces, otherwise I get a parse error!
HTML;

Is there any better way to do this?

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Better than <<HTML or " ??? In reply to
Since no one replied to you.. I will.

NO. You can't.

Since most HTML is done between the PHP code, it really doesn't matter that much. You'll probably prefer to do the quotes and using backslash to escape quotes inside. You'll get used to it real fast. Some people just switch to single quotes inside the double quotes. Unless you're stingy.. you won't really care.

--
jsu
Quote Reply
Re: [Seto Kaiba] Better than <<HTML or " ??? In reply to
Thanks for the reply :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!