Gossamer Forum
Home : General : Chit Chat :

qq~

Quote Reply
qq~
I have, for years, used Perl for all my web development and have starting tinkering with PHP.

If I want to assign a large text block to a variable is there a qq~ equivalent in PHP as there is in Perl?

Example:

$textblock = qq~ Line 1
...
Line 12
...
~;

Can that, and if so, how is that, done in PHP?
Quote Reply
Re: [Lee] qq~ In reply to
$text = <<<HTML
Line 1
...
Line 12
...

HTML;


will work if you want to assign text to a string variable without escaping special / reserved characters.

----
Cheers,

Dan
Principal

Virtual Solutions
Quote Reply
Re: [Lee] qq~ In reply to
If you use the method Dan provided (be *sure* that the end WORD; part is totally over to the left of the page. If it isn't, you will get a parse error).

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates