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