PHP Echo & Print MCQs

11. which of the following is correct echo statement?

A. echo "<h2>PHP is Fun!</h2>";
B. echo "PHP is Fun!<br>";
C. echo "PHP ", "is ", "Fun!";
D. All of the above

View Answer


12. which of the following is correct print statement?

A. print "<h2>PHP is Fun!</h2>";
B. print "PHP is Fun!<br>";
C. print "PHP ", "is ", "Fun!";
D. All of the above

View Answer


13. What will be the output of the following PHP code?

<?php
echo "This is <i>Letsfindcourse</i>";
?>

A. This is Letsfindcourse
B. This is Letsfindcourse(Letsfindcourse in italic)
C. This is
D. Error

View Answer


14. What will be the output of the following PHP code?

<?php
$arr = array('0' => "Letsfindcourse", 
             '1' => "Computer",  
             '2' => "Science", 
             '3' => "Portal"); 

print_r($arr[-1]); 
?>

A. Portal
B. Letsfindcourse
C. Error
D. No Output

View Answer


15. What will be the output of the following PHP code?

<?php
$arr = array('0' => "Letsfindcourse", 
             '1' => "Computer",  
             '2' => "Science", 
             '3' => "Portal"); 

print_r($arr[0]); 
?>

A. Portal
B. Letsfindcourse
C. Error
D. No Output

View Answer


16. What will be the output of the following PHP code?

<?php
echo 'This is  "letsfindcourse"' ;
?>

A. This is letsfindcourse
B. This is "letsfindcourse"
C. Error
D. No Output

View Answer


17. What will be the output of the following PHP code?

<?php
echo "This is  "echo statement" ";
?>

A. This is "echo statement"
B. echo statement
C. Error
D. No Output

View Answer


18. What will be the output of the following PHP code?

<?php
echo "This","is"|"a","PHP"."MCQs";
?>

A. ThisisaPHPMCQs
B. ThisisPHPMCQs
C. Thisis a PHPMCQs
D. Thisis aPHPMCQS

View Answer


19. What will be the output of the following PHP code?

<?php
echo "This","is"&"a","PHP"."MCQs";
?>

A. ThisisaPHPMCQs
B. Thisis PHPMCQs
C. This aPHPMCQS
D. ThisaPHPMCQs

View Answer


20. What will be the output of the following PHP code?

<?php
echo "This","is"@"a","PHP"."MCQs";
?>

A. Thisis@aPHPMCQs
B. ThisaPHPMCQs
C. No Output
D. Error

View Answer





Discussion


* You must be logged in to add comment.