Why is the <br/> not working ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Why is the <br/> not working ?

I would like to include a line break on each output but am getting an error. What could be wrong in the code ? <?php $nee = ['hasu', "John", "richard", "young", "vayo"]; foreach($nee as $x){ echo($x '<br/>'); } ?>

26th Aug 2017, 8:36 AM
Peter - avatar
2 Answers
+ 3
echo $x.'<br/>'; The parentheses aren't needed. Use the . for concatenation of $x and the string '<br/>'
26th Aug 2017, 8:40 AM
ChaoticDawg - avatar
+ 1
thank you very much.
26th Aug 2017, 8:42 AM
Peter - avatar