Q. Variables always start with a ........ in PHP

  • (A) Pond-sign
  • (B) Yen-sign
  • (C) Dollar-sign
  • (D) Euro-sign
πŸ’¬ Discuss
βœ… Correct Answer: (C) Dollar-sign

Q. Which of the following is not valid PHP code?

  • (A) $_10
  • (B) ${β€œMyVar”}
  • (C) &$something
  • (D) $10_somethings
πŸ’¬ Discuss
βœ… Correct Answer: (D) $10_somethings

Q. You can test the type of any variable with the ..... function.

  • (A) whattype()
  • (B) showtype()
  • (C) gettype()
  • (D) settype()
πŸ’¬ Discuss
βœ… Correct Answer: (C) gettype()

Q. If you echo a Boolean variable, the value FALSE displays as a .... and the value TRUE echoes as a .....

  • (A) 0, 1
  • (B) blank string, 2
  • (C) empty variable, 1
  • (D) blank string, 1
πŸ’¬ Discuss
βœ… Correct Answer: (D) blank string, 1

Q. String values must be enclosed in ......

  • (A) single quotes
  • (B) double quotes
  • (C) both A and B
  • (D) none of above
πŸ’¬ Discuss
βœ… Correct Answer: (C) both A and B

Q. PHP ..... demand that you declare a data type when you create a variable.

  • (A) does
  • (B) does not
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) does not

Q. strval()

  • (A) Accepts a value and converts it into a string array
  • (B) None of above
  • (C) Accepts a value and converts it into an string dictionary
  • (D) Accepts a value and converts it into string equivalent
πŸ’¬ Discuss
βœ… Correct Answer: (D) Accepts a value and converts it into string equivalent

Q. What is the limit of a PHP integer value?

  • (A) 16384
  • (B) 65536
  • (C) 1048576
  • (D) 2147483647
πŸ’¬ Discuss
βœ… Correct Answer: (D) 2147483647

Q. PHP considers the following values as False

  • (A) the integer 0
  • (B) the one-character string 0
  • (C) constant NULL
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What will be the output of the following PHP code?

Code:
<?php
function start($string)
{
    if ($string < 45)
        return 20;
    else
        return 40;
}
$t = start(90);
if ($t < 20)
{
    echo "Have a good day!";
}
else
{
    echo "Have a good night!";
}
?>
  • (A) ERROR
  • (B) Have a good day!
  • (C) Have a good night!
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Have a good night!