Submitted by sunil kumar (not verified) on Sun, 08/30/2009 - 22:11.
I want to combine two variables together: $var1 = 'Welcome to '; $var2 = 'TechInterviews.com'; What will work faster? Code sample 1: $var 3 = $var1.$var2; Or code sample 2: $var3 = "$var1$var2";
php question
I want to combine two variables together: $var1 = 'Welcome to '; $var2 = 'TechInterviews.com'; What will work faster? Code sample 1: $var 3 = $var1.$var2; Or code sample 2: $var3 = "$var1$var2";
code sample 1 works faster.
code sample 1 works faster. Because concatenation of strings works faster than substitution..
Post new comment