Level 75
if (in_array($geoip_code, Arr::wrap($item['restricted_countries']))) {
return $item;
}
Docs: https://laravel.com/docs/8.x/helpers#method-array-wrap
1 like
in_array(): Argument #2 must be of type array, string given
Sometimes i dont have an array $item['restricted_countries']), but how to return empty array, instead string?
if ( in_array($geoip_code, $item['restricted_countries']) ) {
return $item;
}
if (in_array($geoip_code, Arr::wrap($item['restricted_countries']))) {
return $item;
}
Docs: https://laravel.com/docs/8.x/helpers#method-array-wrap
Please or to participate in this conversation.