Skip to content

PHP MCQ Questions

0
Answered
0
Correct
0%
Accuracy
Q51 Easy

What is the correct ways to create an arrays in PHP higher then version 5.3 Note: there may be more then one correct answer

Q52 Easy

What is one of the difference between the use of single quotes and double quotes in PHP syntax?

Q53 Easy

What is the use of the CDATA section in XML?

Q54 Easy

What is the GD Library?

Q55 Easy

What is the output of flowing code?

Q56 Easy

What is the right way to set a value on an object stdClass?

Q57 Easy

What is the output of the following code? $one='two'; $two='one'; echo $$$one;

Q58 Easy

What is the standard PHP function to send emails?

Q59 Easy

What is "empty()"?

Q60 Easy

What is the value of $result in this calculation? $result = 25 % 6;

Q61 Easy

What is the output of the following code? <?php echo "<pre>"; $array1 = array( "1"=>"a", "2"=>"b", "3"=>"c" ); $array = array_flip($array1); print_r($array); echo "</pre>"; ?>

Q62 Easy

Which of these is not a valid SimpleXML Parser method?

Q63 Easy

What is the official website of PHP

Q64 Easy

What is a collection of characters that is treated as one entity called?

Q65 Easy

What is meant by Synchronous Server Calls within PHP's cURL features?

Q66 Easy

What is the output of the following code? <?php $a = 123; $b = "123"; if ($a == $b) echo 'A'; if ($a === $b) echo 'B'; ?>

Q67 Easy

What is output by the following: $c = 1; ++$c; echo $c++;

Q68 Easy

What is the value of $a in the following:

Q69 Easy

What is the time interval in the given dateInterval object specification: new DateInterval("P0000-10-00T00:01:01");

Q70 Easy

In PHP 7, What is the correct way to import multiple classes from namespace in a single declaration ?!

Q71 Easy

What is the best practice for running MySQL queries in PHP? Consider the risk of SQL injection.

Q72 Easy

What is the correct line to use within the php.ini file, to specify that 128MB wouldbe the maximum amount of memory that a script may use?

Q73 Easy

What is the cause of 'Cannot modify header information - headers already sent'?

Q74 Easy

What is the correct way to read-in multiple values from an array?

Q75 Easy

Which PHP function would you use to display information about variables in a simple, readable format?

Q76 Easy

What is the difference between “echo” and “print” in PHP?

Q77 Easy

What is a salted MD5 hashed password?

Q78 Easy

What is the result of the following code: $array[]="value";

Q79 Easy

What is the output of the following code? $foo = 'bar'; $bar = 'bar' $$foo = 'foo' echo '$foo', '$bar';

Q80 Easy

What is the value of $total in this calculation?$total = 2 + 5 * 20 - 6 / 3

Q81 Easy

What is the initial value of a integer and float variable?

Q82 Easy

What is the fastest way to insert an item $item into the specified position $position of the array $array?

Q83 Easy

What is wrong with the following code?curl_setopt($ch, CURLOPT_URL,“http://www.example.com/”);curl_setopt($ch, CURLOPT_HEADER, 0);curl_exec($ch);curl_close($ch);?>

Q84 Easy

What is the use of memory_get_peak_usage()?

Q85 Easy

What is the cause of this warning: 'Warning: Cannot modify header information - headers already sent'?

Q86 Easy

What is the output of these line of codes?

Q87 Easy

What is the string concatenation operator in PHP?

Q88 Easy

What is “?” ?

Q89 Easy

What is the use of the @ symbol in front of a variable?

Q90 Easy

What is output to the screen when executing code: $> php -r

Q91 Easy

What is the correct way to assign a class constant?

Q92 Easy

What is the scope of a PHP constant? Declared using define()

Q93 Easy

What is the correct way to send a SMTP (Simple Mail Transfer Protocol) emailusing PHP?

Q94 Easy

What is the result of calling json_encode() on an empty array?

Q95 Easy

What is the result of the following code : "<?php echo (strpos('abcdef', 'a')) ? : -1; ?>"

Q96 Easy

What is the correct syntax of constructor function?

Q97 Easy

What is the syntax of a class in PHP?

Q98 Easy

Assume that $r is 255, and $g and $b are both 0. What is the correct code to output "#ff0000"?

Q99 Easy

What is the output?A.syntax errorB.falsefalseC.trueD.falseE.None of the theseCheck Answer

Q100 Easy

What is the correct way to add 1 to the $a variable?

Showing 100 of 138 questions