<?php $array = ['oooo', 'no', 'mmmm', 'yes']; $needle = 'Yes'; echo (function($haystack, $needle) { foreach ($haystack as $i => $v) { if (stripos($v, $needle) !== false) { return $i; } } return null; })($array, $needle) ?? 'Not found';
You have javascript disabled. You will not be able to edit any code.