PHP Echo & Print MCQs

This section focuses on "Echo and Print" in PHP. These Multiple Choice Questions (mcq) should be practiced to improve the PHP skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. How many ways user can print output in PHP?

A. 1
B. 2
C. 3
D. 4

View Answer


2. print statement can take _____ argument?

A. 1
B. 2
C. 3
D. 4

View Answer


3. How many return value does echo statement has?

A. 1
B. 2
C. 3
D. 0

View Answer


4. Echo statement is written under parentheses?

A. True
B. False
C. Only for string it written under parentheses
D. Only for variable it written under parentheses

View Answer


5. Which statement is faster amoung echo and print?

A. echo
B. print
C. echo and print has same speed
D. None of the above

View Answer


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

<?php
echo "Hello world </br> I am learning PHP at letsfindcourse";
?>

A. Hello world
B. Hello world I am learning PHP at letsfindcourse
C. Hello world
I am learning PHP at letsfindcourse
D. Error

View Answer


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

<?php
$five = 5;
print($five);
print $five;
?>

A. 05
B. 55
C. 50
D. Error

View Answer


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

<?php
$a = "Hello";
$b = "World";
echo "$a"+"$b";
?>

A. HelloWorld
B. Hello+World
C. 0
D. Error

View Answer


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

<?php
$a = "hello";
$b = "world";
print($a$b);
?>

A. helloworld
B. hello
C. Nothing
D. error

View Answer


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

<?php
print("I"."am"."learning"."php");
?>

A. Iamlearningphp
B. I am learning php
C. Nothing
D. error

View Answer





Also check :


Discussion


* You must be logged in to add comment.