Jump to content

Need a little help here.. [SOLVED]


Kyle

Recommended Posts

  • Moderators

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!

Link to comment
Share on other sites

  • Administrators

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
}

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...