Moderators Kyle Posted March 5, 2012 Moderators Report Posted March 5, 2012 Hey, I need some help here dealing with multiple parameters code. I have 6 retired status, but I want to look for pilots who has a status of 2 and 4 together I tried the following but not a success $params = array('retired' => 2,4); $params = array('retired' => 2 AND 4); Hopefully someone can help me to achieve that. Cheers! Quote
Administrators Nabeel Posted March 5, 2012 Administrators Report Posted March 5, 2012 The same parameter can't have two values, unless it's a nested array: $params = array( 'retired' => array(2, 4) ); if(in_array(2, $params['retired']) && in_array(4, $params['retired'])) { // both values exist } 1 Quote
Moderators Kyle Posted March 5, 2012 Author Moderators Report Posted March 5, 2012 Thanks Nabeel. That did the trick. Cheers! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.