I have the results of a mysql query in a multi dimentional array as follows:
Array (
[0] => stdClass Object ( [name] => john doe [id] => john@doe.com [userlevel] => 1 )
[1] => stdClass Object ( [name] => mary jane [id] => mary@jane.com [userlevel] => 5 )
[2] => stdClass Object ( [name] => joe blow [id] => joe@blow.com [userlevel] => 1 )
);
I would like to loop through these, check the value of the [userlevel] value and if == ‘5’, then modify the [name] value. The idea is to give a visual indicator next to those users that are a certain userlevel.
I’ve tried to loop through using foreach, but I can’t get it to work.
What have you tried? Something like this should work.