PHP Concatenation and Quotes Question

Discussion in 'Website Development & Design' started by Fergal, Dec 22, 2012.

  1. Fergal

    Fergal
    uix_expand uix_collapse
    Premium Member
    Premium Member

    Joined:
    Nov 18, 2007
    Messages:
    10,575
    Likes Received:
    1,165
    I understand that PH code inside single quotes runs faster than codes inside double quotes, because PHP looks for variables inside double quotes but not inside single quotes.

    Where $number1 is a variable, which of the following pieces of code will run faster?

    1. echo "The number is $number1";

    OR

    2. echo "The number is " . $number1;

    Thanks!
     

Share This Page