jamesxg1 Posted December 9, 2010 Share Posted December 9, 2010 Hiya peeps, I was wondering if anyone could help. I have a search page that returns and array, if there are no results. It will either not exist or it will be empty. I was wondering how I would check this and if its not empty how I would count how many other arrays are inside it, as it will be array(array(1=>'1', 2=>'2')); if it is not empty, for instance. if(empty($searchObj->compResult) OR !isset($searchObj->compResult)) { echo 'its empty'; } else { $count = count($searchObj->compResult); } Many thanks, James. Link to comment https://forums.phpfreaks.com/topic/221159-array-if-statment-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.