I\'m having two arrays as follows:
$user_ids = Array
(
[0] => 159a8a6f1c00c5c4d5d0daaab2aa4227
[1] => a39777761f7816031aec676c80c3a8ad
[2] =>
You don't need a nested foreach to do this. It's easy to do with array_combine(). Create a new array by using ids as keys and statuses as values, and then loop through the array and call the function as you need it:
$array = array_combine($user_ids, $user_statuses);
$array = array_map('trim', $array); // remove whitespaces
foreach ($array as $id => $status) {
if($status == 'disable') {
$objAdminUsers->UpdateUserStatus($id, $status);
$count++;
}
}
Demo!