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
π Set complete! All 9 questions answered.
Question 1 of 9
β
FPSC
β
PPSC
β
FPSC
β
PPSC
Question 2 of 9
β
FPSC
β
PPSC
β
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
β
FPSC
β
PPSC
Which one of the following does not describe a validating filter?
Question 4 of 9
β
FPSC
β
PPSC
β
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
β
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
β
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
β
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
β
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
β
FPSC
β
PPSC
Which one of the following filter checks if variable of specified type exists?
β Link copied to clipboard
Continue Your Practice
Next Practice Set β Advance Html β Part 1
Master the next curriculum module with 40 exam-standard MCQs.
π‘ 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 β Advance Html β Part 1
40 MCQs
Practice β
Advance Html β Part 2
40 MCQs
Practice β
Advanced Oop Concepts
24 MCQs
Practice β
Advanced Topics In R Programming β Part 1
40 MCQs
Practice β
Advanced Topics In R Programming β Part 2
40 MCQs
Practice β
Advanced Topics In Ruby β Part 1
40 MCQs
Practice β