Q.1.
What is PHP?
Q.2.
Who is the father of PHP?
Q.3.
What does PHP stand for?
Q.4.
Which of the following is the correct syntax to write a PHP code?
Q.5.
Which of the following is the correct way to add a comment in PHP code?
Q.6.
Which of the following is the default file extension of PHP files?
Q.7.
How to define a function in PHP?
Q.8.
What will be the output of the following PHP code? <?php $x =$y =if ($x > $y && 1|| print "PHP MCQ" ; else print "Welcome to Sanfoundry"; ?>
Q.9.
Which is the right way of declaring a variable in PHP?
Q.10.
What will be the output of the following PHP program? <?php $fruits = array ("apple", "orange", array ("pear", "mango"),"banana"); echo (count($fruits, 1)); ?>
Q.11.
What will be the output of the following PHP program? <?php function multi($num) { if ($num == echo "I Wonder"; if ($num == echo "Which One"; if ($num == echo "Is The"; if ($num == echo "Correct Answer"; } $can = stripos("I love php, I love php too!","PHP"); multi($can); ?>
Q.12.
Which of the following PHP functions can be used for generating unique ids?
Q.13.
In the following PHP program, what is/are the properties? <?php class Example { public $name; function Sample() { echo "Learn PHP @ Sanfoundry"; } } ?>
Q.14.
What will be the output of the following PHP code? <?php define("GREETING", "PHP is a scripting language"); echo $GREETING; ?>
Q.15.
A function in PHP which starts with __ (double underscore) is known as __________
Q.16.
How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
Q.17.
Which of the following web servers are required to run the PHP script?
Q.18.
What will be the output of the following PHP code snippet? <?php $url = "[email protected]"; echo ltrim(strstr($url, "@"),"@"); ?>
Q.19.
Which of the following PHP functions can be used to get the current memory usage?
Q.20.
Which one of the following PHP function is used to determine a file’s last access time?