I'd like to create new array with IDs where users have access to sector.
$sector = '60';
Create new array with User IDs (2 and 4) in this case...
$result = mysql_query("SELECT user_id, user_sectors FROM admin_users");
while ($row = mysql_fetch_array($result)) {
$id[] = $row[user_id];
$sectors[] = unserialize(base64_decode($row[user_sectors]));
}
$combine = array_combine($id, $sectors);
print "<pre>";
print_r($combine);
print "</pre>";
Array
(
[2] => Array <<<<<<<<<< USER ID
(
[0] => 49 <<<<<<<<<< SECTORS
[1] => 60
[2] => 69
[3] => 65
[4] => 66
[5] => 59
[6] => 71
[7] => 57
)
[3] => Array <<<<<<<<<< USER ID
(
[0] => 49 <<<<<<<<<< SECTORS
)
[4] => Array <<<<<<<<<< USER ID
(
[0] => 49 <<<<<<<<<< SECTORS
[1] => 60
[2] => 65
[3] => 58
)
)