Solved

display result vertically

Posted on 2004-04-15
6
204 Views
Last Modified: 2008-03-10
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
0
Comment
Question by:manish14
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 20 total points
ID: 10831237
<ul>
<?php
foreach ($array as $item) {
  print "   <li> $item </li>\n";
}
?>
</ul>
0
 
LVL 6

Expert Comment

by:jkna_gunn
ID: 10831533
or if you dont want listed
just use a <br> tag

foreach ($array as $item) {
  print "$item <br>\n";
}
0
 
LVL 17

Expert Comment

by:dorward
ID: 10831550
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

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question