214 quizzes found.

Which of the following tags are an acceptable way to begin a PHP Code block?

  1. <SCRIPT LANGUAGE="php">
  2. <!
  3. <%
  4. <?php
  5. <?

Choose 4 answers

Which of the following are valid PHP variables?

  1. @$foo
  2. &$variable
  3. ${0x0}
  4. $variable
  5. $0x0

Choose 4 answers

PHP variables cannot start with a number

What is the best way to iterate and modify every element of an array using PHP 5?

  1. You cannot modify an array during iteration
  2. for($i = 0; $i < count($array); $i++) { /* ... */ }
  3. foreach($array as $key => &$val) { /* ... */ }
  4. foreach($array as $key => $val) { /* ... */ }
  5. while(list($key, $val) = each($array)) { /* ... */}

Choose 1 answers

What is the output of the following PHP script?

<?phpdefine('FOO', 10);$array = array(10 => FOO, "FOO" => 20);print $array[$array[FOO]] * $array["FOO"];?>
  1. FOO
  2. 100
  3. 200
  4. 20
  5. 10

Choose 1 answers

What is the output of the following PHP code?

<?php$a = 1;$b = 2.5;$c = 0xFF;$d = $b + $c;$e = $d * $b;$f = ($d + $e) % $a;print ($f + $e);?>
  1. 643.75
  2. 432
  3. 643
  4. 257
  5. 432.75

Choose 1 answers