<?php $listing = [ [ "sku,qty,is_in_stock" ], [ "EBCDAA014MAS34B,149.000000,1" ] ]; function array_find($needle, array $haystack) { foreach ($haystack as $key => $value) { if (false !== stripos($value[0], $needle)) { return $key; } } return false; } $hello = array_find('EBCDAA014MAS34B', $listing); echo $hello; echo PHP_EOL; $test = array_find('QEBCDAA014MAS34B', $listing); var_dump($test);
You have javascript disabled. You will not be able to edit any code.