PHP MCQs with answers Page - 4

Dear candidates you will find MCQ questions of PHP here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

Y

Yogesh • 7.43K Points
Tutor III

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

  • (A) Pond-sign
  • (B) Yen-sign
  • (C) Dollar-sign
  • (D) Euro-sign

Y

Yogesh • 7.43K Points
Tutor III

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

  • (A) $_10
  • (B) ${“MyVar”}
  • (C) &$something
  • (D) $10_somethings

Y

Yogesh • 7.43K Points
Tutor III

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

  • (A) whattype()
  • (B) showtype()
  • (C) gettype()
  • (D) settype()

Y

Yogesh • 7.43K Points
Tutor III

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

Y

Yogesh • 7.43K Points
Tutor III

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

  • (A) single quotes
  • (B) double quotes
  • (C) both A and B
  • (D) none of above

Y

Yogesh • 7.43K Points
Tutor III

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

  • (A) does
  • (B) does not
  • (C) ---
  • (D) ---

Y

Yogesh • 7.43K Points
Tutor III

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

Y

Yogesh • 7.43K Points
Tutor III

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

  • (A) 16384
  • (B) 65536
  • (C) 1048576
  • (D) 2147483647

Y

Yogesh • 7.43K Points
Tutor III

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

Y

Yogesh • 7.43K Points
Tutor III

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

Loding content...

Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.

Image

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.