php - what is the fastest method to check if given array has array or non-array or both values? -


We have given a given array that can be in 4 states.

The values ​​in the array are: <

  • The array and non array only
  • the array has no value
  • only arrays
  • Some confusion:

      function isArray ($ subtraction, $ currentValue) / ul>  

    Different states can then be evaluated as follows:

    1. arrays only

        Count ($ array) == $ number_of_arrays  
    2. only non-arrays

        $ number_of_arrays == 0  
    3. There is no key in the array

        below ($ array);  

    So you just have to type the function that gives the appropriate status.

    Reference:,


  • Comments