Control Structures Loop In Php(Computer Science > Php Program ) Questions and Answers

Question 1. What will be the output of the following PHP code?
  1.    how are u
  2.    hi
  3.    error
  4.    no output
Explanation:-
Answer: Option A. -> how are u

Question 2. What will be the output of the following PHP code ?
  1.    hi
  2.    no output
  3.    error
  4.    how are u
Explanation:-
Answer: Option D. -> how are u

Question 3. What will be the output of the following PHP code ?
  1.    how are uhello
  2.    hihello
  3.    hi
  4.    no output
Explanation:-
Answer: Option B. -> hihello

Question 4. What will be the output of the following PHP code ?
  1.    true
  2.    false
  3.    error
  4.    no output
Explanation:-
Answer: Option A. -> true

Question 5. What will be the output of the following PHP code ?
  1.    all
  2.    some
  3.    error
  4.    none
Explanation:-
Answer: Option C. -> error

Question 6. What will be the output of the following PHP code ?
  1.    all
  2.    some
  3.    error
  4.    no output
Explanation:-
Answer: Option C. -> error

Question 7. What will be the output of the following PHP code ?
  1.    0how are u
  2.    0hi
  3.    hi
  4.    how are u
Explanation:-
Answer: Option B. -> 0hi

Question 8. What will be the output of the following PHP code ?
  1.    0
  2.    1
  3.    error
  4.    how are u
Explanation:-
Answer: Option D. -> how are u

Question 9. What will be the output of the following PHP code ?
  1.    error
  2.    2
  3.    hi
  4.    how are u
Explanation:-
Answer: Option B. -> 2

Question 10. What will be the output of the following PHP code ?
  1.    0
  2.    1
  3.    error
  4.    how are u
Explanation:-
Answer: Option D. -> how are u