Results 1 to 4 of 4

Thread: php qq() equivilent?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 1999
    Posts
    38

    php qq() equivilent?

    is there an equivilent to perls qq() function?


    Code:
    print qq(some text with unescaped quotes " here " );
    thanks
    I swear you guys rip on me 13 or 14 more times, i'm outta here...

  2. #2
    scoutt
    Guest
    I am not sure if there is. can you explain this one to me though.
    Code:
    # Double quotes: qq() 
    $firstVar = 1; 
    $secondVar = qq($firstVar); 
    print "with qq() secondVar = $secondVar\n"; 
    
    Prints: with qq() secondVar = 1
    what exactly is the qq() doing??? I don't see it doing anything.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 1999
    Posts
    38
    well, qq() will basically just let you specify a string without escaping quotes.

    for example:

    Code:
    $this = "and god said \" let there be light \"";
    $that = qq(and god said "let there be light");
    $this and $that both == and god said "let there be light"
    I swear you guys rip on me 13 or 14 more times, i'm outta here...

  4. #4
    scoutt
    Guest
    thanks, that makes more since. the only thing I can think of is stripslashes(). other than that I don't know. can't you use single quotes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width