Q. What will be the output of the following PHP code ?
Code:
<?php $str1 = "Hello "; $str2 = "MCQ"; $str3 = "Buddy"; $str1 .= $str2 .= $str3 ; echo $str1; echo $str2; ?>
β
Correct Answer: (C)
Hello MCQ Buddy MCQ Buddy
Explanation: The str1 .= str2 is a shorthand for str1 = str1.str2 and this is evaluated from right to left.