ExamVeda
Login
Home
This question belongs to PHP Regular Expressions
Regular Expressions
?

What will be the output of the following PHP code?
<?php
$number = array(0,1,two,three,four,5);
$num = preg_grep("/[0-5]/", $number);
print_r($num);
?>

Answer & Solution
Correct Answer: Option D
The preg_grep function is used to search an array for specific patterns and then return a new array based on that filtering.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.