What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);?

🎲 Try a Random Question  |  Total Questions in Quiz: 10  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
PHP Programming Basics Practice Test: Basics of Preg in PHP — practice the complete quiz, review flashcards, or try a random question.

The preg_match() function is a built-in function of PHP that performs a regular expression match. This function searches the string for pattern, and returns true if the pattern exists otherwise returns false. Generally, the searching starts from the beginning of $subject string parameter.

Related Test: PHP Programming Basics Practice Test: Strings And Regular Expression in PHP


What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);?