Solved

display result vertically

Posted on 2004-04-15
6
200 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
Comment Utility
<ul>
<?php
foreach ($array as $item) {
  print "   <li> $item </li>\n";
}
?>
</ul>
0
 
LVL 6

Expert Comment

by:jkna_gunn
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
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.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now