PHP Programming Quiz


Play this quiz that will help you to excel in PHP certification exams, placements etc. This PHP programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This PHP programming test enables you to assess your knowledge of PHP programming.

Take the Free Practice Test



PHP MCQs

Practice PHP MCQ Questions, which will help you to clear your PHP Programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

PHP Quiz

Try Free PHP Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

PHP Quiz

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

<?php 
   $url = "lfc123456@example.com";
   echo ltrim(strstr($url, "@"),"@");
?>

lfc123456@example.com
lfc123456
lfc123456@
example.com

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

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

Iamlearningphp
I am learning php
Nothing
error

3. A function name always begins with the keyword _________.

fun
def
function
None of the above

4. print statement can take _____ argument?

1
2
3
4

5. which of the following is correct print statement?

print "<h2>PHP is Fun!</h2>";
print "PHP is Fun!<br>";
print "PHP ", "is ", "Fun!";
All of the above

6. PHP supports ____ types of looping techniques?

2
3
4
5

7. What will be the syntax of defining the class?

class lfc ()
class lfc []
class lfc {}
lfc class{}

8. Which of the following function is Used to set the array pointer to the value of last key?

last()
end()
next()
final()

9. Predict the output of the following code.

<?php

$a=array(1,2,3,5,6);
next($a);
next($a);
next($a);
echo current($a);

?>

2
3
4
5

10. Close the file with fclose() function.

Yes
No
Can be yes or no
Can not say

Results