Home > other >  PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array,
PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array,

Time:05-16

PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, mysqli given in /var/www/html/xxxxx/includes/outer-ajax.php:25

how can I solve ? I've tried everything

CodePudding user response:

Make sure the second parameter in the function array_key_exists is an Array data type

check PHP official website for more info.

CodePudding user response:

First of all you have to check if your given second parameter is array: is_array(mixed $value): bool

If it is array you can pass your parameter into array_key_exists(string|int $key, array $array): bool

If your second parameter is type of object or class you have to check if property_exists(object|string $object_or_class, string $property): bool

  • Related