?
What will be the output of the following PHP code?
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);
?>
<?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.
Join the Discussion
Login to post a comment or share your explanation.
Login