adplus-dvertising

Welcome to the Error and Exception Handling in PHP MCQs Page

Dive deep into the fascinating world of Error and Exception Handling in PHP with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Error and Exception Handling in PHP, a crucial aspect of PHP. In this section, you will encounter a diverse range of MCQs that cover various aspects of Error and Exception Handling in PHP, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within PHP.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Error and Exception Handling in PHP. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of PHP.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Error and Exception Handling in PHP. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Error and Exception Handling in PHP MCQs | Page 3 of 3

Explore more Topics under PHP

Q21.
Which of the following is/are an external data?

i) Cookies
ii) Input data from a form
iii) Server Variables
iv) Web services data
Discuss
Answer: (d).All of the mentioned
Q22.
How many types of filtering are present in PHP?
Discuss
Answer: (b).2
Q23.
Which one of the following filter is used to filter several variables with the same or different filters?
Discuss
Answer: (a).filter_var_array()
Q24.
What will be the output of the following PHP code?
<?php
    $num = "123";
    if (!filter_var($num, FILTER_VALIDATE_INT))
        echo("Integer is not valid");
    else
        echo("Integer is valid");
    ?>
Discuss
Answer: (c).Integer is valid
Discuss
Answer: (a).Are used to allow or disallow specific characters in a string
Q26.
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");
    ?>
Discuss
Answer: (b).Integer is not valid
Q27.
Which one of the following filter checks if variable of specified type exists?
Discuss
Answer: (a).filter_has_var
Q28.
What will be the output of the following PHP code?
<?php
    $value = 'car';
    $result = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
    ?>
Discuss
Answer: (c).NULL
Q29.
What will be the output of the following PHP code?
<?php
    function convertSpace($string)
    {
        return str_replace("_", " ", $string);
    }
    $string = "Peter_is_a_great_guy!";
    echo filter_var($string, FILTER_CALLBACK, array("options"=>"convertSpace"));
    ?>
Discuss
Answer: (c).Peter is a great guy!
Page 3 of 3

Suggested Topics

Are you eager to expand your knowledge beyond PHP? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!