how to check if the array exists in php.
I ve the array called $contact["categories"] in some of the rows in mongodb collection. some rows doesn't have that array. how to check if particular array exists in collection??
you can check the index existence like this:
OR
|
||||
|
Use $exists parameter to check whether element exists or not.
|
|||
|
$exists
operator – Sergio Tulentsev Aug 10 '12 at 11:34