Here you can find PHP Questions and Answers.
In this PHP Questions and Answers section you can learn and practice PHP Questions and Answers to improve your skills in order to face technical inerview conducted by organisations. By Practicing these interview questions, you can easily crack any Exams interview.
AllIndiaExams provides you lots PHP Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download PHP Questions and Answers as PDF files and eBooks.
You no need to worry, we have given lots of PHP Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Competitive Exams interview.
1. What does PHP stand for? i) Personal Home Page ii) Hypertext Preprocessor iii) Pretext Hypertext Processor iv) Preprocessor Home Page
2. Who is the father of PHP?
3. PHP files have a default file extension of.
4. A PHP script should start with ___ and end with ___:
5. Which of the looping statements is/are supported by PHP? i) for loop ii) while loop iii) do-while loop iv) foreach loop
1. Which one of the following PHP functions can be used to build a function that accepts any number of arguments?
2. Which one of the following PHP functions can be used to find files?
3. The filesize() function returns the file size in ___.
4. Which one of the following PHP function is used to determine a file’s last access time?
5. Which one of the following function is capable of reading a file into an array?
1. PHP’s numerically indexed array begin with position __.
2. Which of the functions is used to sort an array in descending order?
3. Which of the following are correct ways of creating an array? (i) state = “karnataka”; (ii) $state = array(“karnataka”); (iii) $state = “karnataka”; (iv) $state = array(“karnataka”);
4. What will be the output of the following PHP code? < ?php $fruits = array ("mango", "apple", "pear", "peach"); $fruits = array_flip($fruits); echo ($fruits); ?>
What will be the output of the following php code? < ?php $states = array("karnataka" => array ( "population" => "11,35,000", "captial" => "Bangalore"), "Tamil Nadu" => array( "population" => "17,90,000", "captial" => "Chennai") ); echo $states["karnataka"]["population"]; ?>
1. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
2. Say we have two compare two strings which of the following function/functions can you use? (i) strcmp() (ii) strcasecmp() (iii) strspn() (iv) strcspn()
3. Which one of the following functions will convert a string to all uppercase?
4. What will be the output of the following PHP code? < ?php $title = "O'malley wins the heavyweight championship!"; echo ucwords($title); ?>
5. What will be the output of the following PHP code? < ?php echo str_pad("Salad", 5)." is good."; ?>
1. Which method scope prevents a method from being overridden by a subclass?
2. Which of the following statements is/are true about Constructors in PHP? (i) PHP 4 introduced class constructors. (ii) Constructors can accept parameters. (iii) Constructors can call class methods or other functions (iv) Class constructors can call on other constructors.
3. PHP recognizes constructors by the name.
4. Which version of PHP introduced the instanceof keyword?
5. Which one of the following functions is used to determine whether a class exists?
1. How many error levels are available in PHP?
2. What is the description of Error level E_ERROR?
3. Which version of PHP introduced E_STRICT Error level?
4. Which character do the error_reporting directive use to represent the logical operator NOT?
5. Which version of PHP was added with Exception handling?
1. Which two predefined variables are used to retrieve information from forms?
2. The attack which involves the insertion of malicious code into a page frequented by other users is known as..
3. When you use the $_GET variable to collect data, the data is visible to..
4. When you use the $_POST variable to collect data, the data is visible to..
5. Which variable is used to collect form data sent with both the GET and POST methods?
1. Which one of the following databases has PHP supported almost since the beginning?
2. The updated MySQL extension released with PHP 5 is typically referred to as..
3. Which one of the following lines need to be uncommented or added in the php.ini file so as to enable mysqli extension?
4. In which version of PHP was MySQL Native Driver(also known as mysqlnd) introduced?
5. Which one of the following statements is used to create a table?
1. What will be the output of the following PHP code ? < ?php one = 1; two = 2; three = 3; four = 4; echo "one / two + three / four"; ?>
2. What will be the output of the following PHP code ? < ?php $on$e = 1; $tw$o = 2; $thre$e = 3; $fou$r = 4; echo "$on$e / $tw$o + $thre$e / $fou$r" ; ?>
3. What will be the output of the following PHP code ? < ?php $on_e = 1; $tw_o = 2; $thre_e = 3; $fou_r = 4; echo "$on_e / $tw_o + $thre_e / $fou_r" ; ?>
4. What will be the output of the following PHP code ? < ?php $On_e = 1; $tw_o = 2; $thre_e = 3; $fou_r = 4; echo "$on_e / $tw_o + $thre_e / $fou_r"; ?>
What will be the output of the following PHP code ? < ?php echo $red ; ?>