Check If array is null or not in php

后端 未结 6 1105
庸人自扰
庸人自扰 2020-12-16 12:15

I have an array like below which is generated by parsing a xml url.

The array is

Array
  (
 [Tags] => SimpleXMLElement Object
    (
        [0] =         


        
6条回答
  •  死守一世寂寞
    2020-12-16 13:19

    Right code of two ppl before ^_^

    /* return true if values of array are empty
    */
    function is_array_empty($arr){
       if(is_array($arr)){
          foreach($arr as $value){
             if(!empty($value)){
                return false;
             }
          }
       }
       return true;
    }
    

提交回复
热议问题