I have two for loops given below
foreach($result_access as $acc){
$usr_access_id[] = $acc->id;
$usraccess[] = $acc->rules;
}
> UPDATED
foreach($somearray as $someid){//Updated
foreach($usraccess as $accessusr){
if(in_array($someid,$usraccess)){
$myid = ??;///Here i want the $usraccess associated $acc->id, how can I get that?
}
}
}
As you can see that I want the $myid get assigned with $acc->id which should be associated with the current $usraccess array
Here’s a sane solution:
The insane solution would be: