Can the in_array function compare objects?
in_array
For example, I have an array of objects and I want to add them distinctly to another array. Is it possible t
See http://php.net/manual/en/function.spl-object-hash.php
if ( ! array_key_exists( spl_object_hash( $obj ), $objects ) ) { $objects[ spl_object_hash( $obj ) ] = $obj; }
Cheers