Skip to main content

Php Filter MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Php Filter with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
9
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
11 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus β€’ Oct 14, 2026
9

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/9 answered
βœ“ 0 correct βœ— 0 wrong 0% score
Question 1 of 9
β˜… FPSC β˜… PPSC

How many types of filtering are present in PHP?

Question 2 of 9
β˜… FPSC β˜… PPSC

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" ); ?>

Question 3 of 9
β˜… FPSC β˜… PPSC

Which one of the following does not describe a validating filter?

Question 4 of 9
β˜… FPSC β˜… PPSC

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" ); ?>

Question 5 of 9
β˜… FPSC β˜… PPSC

What will be the output of the following PHP code? <?php $value = 'car' ; $result = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); ?>

Question 6 of 9
β˜… FPSC β˜… PPSC

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" )); ?>

Question 7 of 9
β˜… FPSC β˜… PPSC

Which of the following is/are an external data? 1. Cookies 2. Input data from a form 3. Server Variables 4. Web services data

Question 8 of 9
β˜… FPSC β˜… PPSC

Which one of the following filter is used to filter several variables with the same or different filters?

Question 9 of 9
β˜… FPSC β˜… PPSC

Which one of the following filter checks if variable of specified type exists?

βœ“ Link copied to clipboard
Continue Your Practice

Advance Html β€” Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set β†’

πŸ’‘ Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All β†’
πŸ“š

Study Guides

Topic summaries and syllabus breakdown

Explore Guides β†’
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library β†’
πŸ“±

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App β†’