<?php $animal = array('lion','elephant','tiger'); $search = 'io'; $res = array_filter($animal, function($v, $k) use($search){ return strpos($v, $search); }, ARRAY_FILTER_USE_BOTH); echo '<pre>'; print_r($res);
You have javascript disabled. You will not be able to edit any code.