Solved

display result vertically

Posted on 2004-04-15
6
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

730 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