First, I'd like to apologize in advance for my approximate English (I'm French) :)
I have the following array and can't figure out how to get the data out:
array (size=3)
0 =>
object(stdClass)[23]
public 'id_photo' => string '14' (length=2)
public 'id_user' => string '40' (length=2)
public 'titre' => string 'Ma 2e TOF Mimi' (length=14)
public 'taille' => string '54' (length=2)
public 'nom' => string 'debutScript.PNG' (length=15)
1 =>
object(stdClass)[24]
public 'id_photo' => string '12' (length=2)
public 'id_user' => string '39' (length=2)
public 'titre' => string 'Ma TOF Seb' (length=10)
public 'taille' => string '16' (length=2)
public 'nom' => string 'BDD.PNG' (length=7)
2 =>
object(stdClass)[25]
public 'id_photo' => string '13' (length=2)
public 'id_user' => string '40' (length=2)
public 'titre' => string 'Ma TOF Mimi' (length=11)
public 'taille' => string '24' (length=2)
public 'nom' => string 'COMMUNE.PNG' (length=11)
This is the result of var_dump($res);
I want to know how to display in the var_dump only the objects with id_user are equal to 40 => an array with 2 objects.
So concretely I would like to know how to access to id_user of every object.
Thanks in advance.
foreach($res as $item)and then check if the id matches your expectations:$item->id_user >= 40