0

I am trying to create a system in which administrators can grant access to people simply by putting their user ID in a database field, but more than 1 ID needs to be in the same column.

At the moment I have an array ($id_array) which when print_r'd looks like this:

Array ( [0] => 256 [1] => 211 [2] => 212 [3] => 213 [4] => 214 [5] => 215 ) Array ( [0] => ) 

How would I use the current logged in user's ID ($user_id) and check to see if it is in the $id_array array?

Thanks for any help

1 Answer 1

4

http://php.net/manual/en/function.in-array.php

in_array($user_id, $id_array);
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.