0

I have an array which returns like this:

array (size=1)
  0 => 
    array (size=2)
      'casualty_charge' => null
      'count' => string '0' (length=1)

Now How can I evaluate this array to false where key values for casualty_charge isNullorcountis0`

3
  • you want that if you itrate this array and index is 0 then it should say false? otherwise true. Commented Apr 30, 2015 at 22:00
  • Create a function, iterate the array, job done. Commented Apr 30, 2015 at 22:00
  • @anantkumarsingh - No when key value for casualty_charge=Null or count = 0 I want to evaluate it to false. Commented Apr 30, 2015 at 22:04

1 Answer 1

3

You can iterate through you array to validate your condition:

function false_check($array){
   foreach ($array as $v)
       if(!isset$v['casualty_charge'] or !$v['count']) return false;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.