Hello so I'm writing a php code that allows me to stock the result of sql query in a php array and then Iam conerting the array into a string using the function implode and I am trying to put each row of the table in a new line but when i echo the string I keep having all my results in the same line.
$data=array();
$req=$bdd->prepare("SELECT * FROM tableciqual WHERE (CONVERT(`alim_nom` USING utf8)) LIKE ?");
$req->execute(array("%$nom%"));
while($resultat=$req->fetch()){
$data[] =$resultat['alim_nom'];
}
$d=implode("\r\n",$data);
echo $d;
<pre>and</pre>tags, or put the output somewhere where the browser will respect the newline?implode("<br>",$data);?