Moderators Kyle Posted March 5, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 5, 2012 Administrators Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Kyle Posted March 5, 2012 Author Moderators Report Share Posted March 5, 2012 Thanks Nabeel. That did the trick. Cheers! Quote Link to comment Share on other sites More sharing options...
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.