PHP |
Level:-Basic
|
Q(1) |
How can you enable error reporting in PHP? |
A  | “display_errors” is equal “on” in the php.ini. |
B  | “ini_set('display_errors', 1)” in your script. |
C  | include “error_reporting(E_ALL)” in your code |
D  | All of the above. |
Q(2) |
What will be the output of the following PHP code ?
if (-100)
print "hi" ;
else
print "how are u";
|
A  | how are u |
B  | hi |
C  | Error |
D  | No output |
Level:-Intermediate
|
Q(1) |
How can we register the variables into a session? |
A  | session_register ($ur_session_var) |
B  | session.register ($ur_session_var) |
C  | session_global ($ur_session_var) |
D  | session_define ($ur_session_var) |
Q(2) |
What’s the difference between unset() and unlink() |
A  | unset() sets a variable to “undefined” while unlink() deletes a file we pass to it from the file system. |
B  | unset() deletes a file we pass to it from the file system while unlink() sets a variable to “undefined” |
C  | unset() sets a variable to “null” while unlink() deletes a file we pass to it from the file system. |
D  | unset() sets a variable to “undefined” while unlink() sets a variable to “null”. |
Level:-Expert
|
Q(1) |
What will be the output of the following code?
function fn (&$var)
{
$var = $var - ($var/10*5);
return $var;
}
echo fn(100);
|
A  | 100 |
B  | 50 |
C  | 98 |
D  | Error message |
Q(2) |
What would be the output of following:
$a = '1';
echo $b = &$a;
echo $c = "2$b";
|
A  | 0,0 |
B  | 0,20 |
C  | 1,21 |
D  | 0,2 |