display result vertically

hello
I have a simple question.
I have array, when i display its result it display horizentally but i want to disply it vertically. So how i can do this.

thx
manish14Asked:
Who is Participating?
 
dorwardCommented:
<ul>
<?php
foreach ($array as $item) {
  print "   <li> $item </li>\n";
}
?>
</ul>
0
 
jkna_gunnCommented:
or if you dont want listed
just use a <br> tag

foreach ($array as $item) {
  print "$item <br>\n";
}
0
 
dorwardCommented:
Well yes, although it *should* be marked up as a list if it is a list (you can use CSS to change the presentation, e.g. to remove bullets and margins).

The point though is that if you are generating HTML using PHP, then you need to insert HTML markup that causes line breaks if you want line breaks, and if you are generating text then you should insert a new line character: \n
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.