Sail E0 Webinar

MCQs

Total Questions : 9
Question 1. Which of the following is/are an external data?
1. Cookies
2. Input data from a form
3. Server Variables
4. Web services data
  1.    Only 2
  2.    2 and 3
  3.    None of the mentioned
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned
Question 2. How many types of filtering are present in PHP?
  1.    3
  2.    2
  3.    4
  4.    None
 Discuss Question
Answer: Option B. -> 2
Question 3. Which one of the following filter is used to filter several variables with the same or different filters?
  1.    filter_var_array()
  2.    filter_var()
  3.    filter_input
  4.    filter_input_array
 Discuss Question
Answer: Option A. -> filter_var_array()
Question 4. What will be the output of the following PHP code?
  1.    No output is returned
  2.    Integer is not valid
  3.    Integer is valid
  4.    Error
 Discuss Question
Answer: Option C. -> Integer is valid
Question 5. Which one of the following does not describe a validating filter?
  1.    Are used to allow or disallow specified characters in a string
  2.    Are used to validate user input
  3.    Strict format rules
  4.    Returns the expected type on success or FALSE on failure
 Discuss Question
Answer: Option A. -> Are used to allow or disallow specified characters in a string
Question 6. What will be the output of the following PHP code?
<?php
$var=300;
$int_options = array("options"=>array ("min_range"=>0, "max_range"=>256));
if (!filter_var($var, FILTER_VALIDATE_INT, $int_options))
echo("Integer is not valid");
else
echo("Integer is valid");
?>
  1.    No output is returned
  2.    Integer is not valid
  3.    Integer is valid
  4.    Error
 Discuss Question
Answer: Option B. -> Integer is not valid
Question 7. Which one of the following filter checks if variable of specified type exists?
  1.    filter_has_var
  2.    filter_var
  3.    filter_id
  4.    filter_var_array
 Discuss Question
Answer: Option A. -> filter_has_var
Question 8. What will be the output of the following PHP code?
  1.    FALSE
  2.    TRUE
  3.    NULL
  4.    ERROR
 Discuss Question
Answer: Option C. -> NULL
Question 9. What will be the output of the following PHP code?
  1.    Peter_is_a_great_guy!
  2.    Peterisagreatguy!
  3.    Peter is a great guy!
  4.    Error
 Discuss Question
Answer: Option C. -> Peter is a great guy!

Latest Videos

Latest Test Papers