Intermediate PHP quiz that cover common issues and solutions in PHP programming
This quiz is in PHP quiz collection.
Start quizWhich of the following is correct about preg_match() function?
Which of the following method can be used to create a MySql database using PHP?
Which of the following type of variables are sequences of characters, like 'PHP supports string operations.'?
Which of the following is used to declare a constant?
What will be printed?
$var = '0';
if ($var) {
echo 'true';
} else {
echo 'false';
}
What will be the value of $var?
$var = 1 / 2;
How do we access the value of 'd' later?
$a = array(
'a',
3 => 'b',
1 => 'c',
'd'
);
What will be printed?
$a = array();
if ($a == null) {
echo 'true';
} else {
echo 'false';
}
What will be printed?
if (null === false) {
echo 'true';
} else {
echo 'false';
}
What will be the value of $var below?
$var = true ? '1' : false ? '2' : '3';
What will be printed?
if ('2' == '02') {
echo 'true';
} else {
echo 'false';
}
What will be printed?
$a = array(
null => 'a',
true => 'b',
false => 'c',
0 => 'd',
1 => 'e',
'' => 'f'
);
echo count($a), "\n";
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
Which of the following function creates an array?
Which of the following method of Exception class returns array of the backtrace?
© 2017 QuizBucket.org