I’m working in a class and I have a method which returns :
while ($donnees = $reponse->fetch()){
$temp[$i] = new Membres($donnees['id_membres']);
return '' . $temp[$i]->getPseudo() . '<br>';
$i++;
it only returns the first data of the while, and when I’m using echo instead of return it’s working but the printing is in top of the page.
Try this