I have an array_filter callback function that checks if digits are in an array like so:
$code = "22";
$orders = array_filter(
$orders,
function ($key) use($code) {
return (in_array($code, $key['trans']));
}
);
But this is checking if the trans value has a digit that matches exactly 22, so it's limiting the results.
I'd like to display all trans value's that start with the $code (22) - I'd like to ignore using a for loop if possible, since it'll take longer to display the results.
What can I do instead?