I have an array called $user_ids
that prints as:
Array ( [0] => stdClass Object ( [user_id] => 1 ) [1] => stdClass Object ( [user_id] => 2 ) )
I want to perform send_msg
for every user_id
in the array. In the example above, I want to achieve the equivalent of this:
send_msg( 1, $body_input, $subject_input);
send_msg( 2, $body_input, $subject_input);
This is what I have tried but it doesn't work.
foreach ($user_ids as $user_N){
send_msg( $user_N, $body_input, $subject_input);
}