Source Code:
(back to article)
<?php $arr = ['Example1', 'example2', 'exAmple3', 'other']; $result = preg_grep('/example/i', $arr); foreach ($result as $element) { echo $element . "\n"; } // Output: // Example1 // example2 // exAmple3 ?>
Result:
Report an issue