How to check if a multidimensional array is empty or not?

前端 未结 6 1413
[愿得一人]
[愿得一人] 2021-02-01 05:20

Basically, I have a multidimensional array, and I need to check whether or not it is simply empty, or not.

I currently have an if statement trying to do thi

6条回答
  •  旧巷少年郎
    2021-02-01 05:49

    You can use array_push to avoid this situation,

    $result_array = array();
    

    array_push($result_array,$new_array);

    refer array_push

    Then you can check it using if (!empty($result_array)) { }

提交回复
热议问题