What's the best way to check if an object exists as the key of an array?
// key: $obj, array: $array
array_key_exists($obj, $array);
Results in a PHP Warning: "1st param should be string or integer".
I'm pretty sure you're wanting property_exists()
edit: at time of answer, the title was "array_key_exists but with objects"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With