214 quizzes found.

Given the two values below, which of the following possiblities will print 10 foos20 bars?

<?php$var1 = "10 foos";$var2 = "20 bars";print ???????;?>
  1. None of the above
  2. implode("", array($var1,$var2));
  3. $var1 . $var2
  4. $var1 + $var2
  5. All of the above

Choose 2 answers

Given the string:$var = "john@php.net";Which of the following will extract the TLD (top level domain) of ".net" from the string?

  1. strstr($var, strpos($var, "."));
  2. substr($var, strpos($var, "@"));
  3. substr($var, strstr($var, "."));
  4. substr($var, strpos($var, ".") + 1);
  5. substr($var, strpos($var, "."));

Choose 1 answers

When comparing two strings, which of the following is acceptable?

  1. $a === $b;
  2. strcasecmp($a, $b);
  3. strcmp($a, $b);
  4. $a == $b;
  5. str_compare($a,$b);

Choose 4 answers

A fingerprint of a string can be determined using which of the following?

  1. md5()
  2. hash()
  3. fingerprint()
  4. None of the above

Choose 1 answers

Which of the following is the best way to split a string on the "-=-" pattern?

  1. They all are equally proper methods
  2. str_split($string, strpos($string, "-=-"))
  3. preg_split("-=-", $string);
  4. explode("-=-" $string);

Choose 1 answers