This will speed up you PHP scripts

Discussion in 'PHP' started by baligena, Apr 17, 2011.

  1. #1
    In PHP you can concatenate with a comma instead of a period when using echo. Commas make you script faster. (warning: works only with echo)

    example:

    the fast:
    echo $var . $var2;

    the furious
    echo $var, $var2;
     
    baligena, Apr 17, 2011 IP
  2. Alastair Gilfillan

    Alastair Gilfillan Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #2
    That's not concatenation then, is it, because no new variable's formed. ;)

    Great tip, though! Thanks, it looks like echoing takes 40% less time with commas according to this.
     
    Alastair Gilfillan, Apr 17, 2011 IP