What will be the output of the following PHP code?
<?php
$num = 10;
echo 'What is her age? \n She is $num years old';
?>
<?php
$num = 10;
echo 'What is her age? \n She is $num years old';
?>
A. What is her age? n She is $num years old
B. What is her age? She is $num years old
C. What is her age? She is 10 years old
D. What is her age?n She is 10 years old
Answer: Option A
Solution(By Examveda Team)
When a string is enclosed within single quotes both variables and escape sequences will not be interpreted when the string is parsed.Related Questions on Basic PHP
A. Both 1 and 3
B. Both 2 and 4
C. Only 2
D. Both 1 and 2
Which of the following is/are a PHP code editor?
1. Notepad
2. Notepad++
3. Adobe Dreamweaver
4. PDT
A. Only 4
B. All of the mentioned
C. 1, 2 and 3
D. Only 3
A. All of the mentioned.
B. Only 2
C. 2 and 3
D. 2, 3 and 4
Join The Discussion