PHP Test
PHP Test
$str1 = 'yabadabgyhuadoo';
$str2 = 'yaba';
if (strpos($str1,$str2)) {
} else {
echo "\"" . $str1 . "\" does not contain \"" . $str2 . "\"";
What will be the output of each of the statements below and why?
var_dump(0133 == 133);
var_dump('0133' == 133);
var_dump('0133' === 133);
What is the problem with the code below? What will it output? How
can it be fixed?
$referenceTable = array();
$referenceTable['val1'] = array(1, 2);
$referenceTable['val2'] = 3;
$referenceTable['val3'] = array(4, 5);
$testArray = array();
After the code below is executed, what will be the value of $text and what will strlen($text) return?
Explain your answer.
$text[10] = 'Doe';
$x = NULL;
if ('0xFF' == 255) {
$x = (int)'0xFF';
}What will be the value of $x after this code executes? Explain your answer.