Display array onto html table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Display array onto html table

Postby Shadowrider50 » Mon Jan 30, 2012 9:39 am

How can i display an array onto a html table?
The array i am trying to put onto a table is being pulled from another server.
If you want to see what it's like at the moment, you can see here
"and just pick the 4 checkboxes and input into the text box "Shadowrider50".
It looks very messy without a table or some sort of organization
Shadowrider50
Forum Newbie
 
Posts: 5
Joined: Sat Jan 28, 2012 4:00 am

Re: Display array onto html table

Postby StathisG » Mon Jan 30, 2012 2:11 pm

You'll have to iterate through the array using for or foreach (check the examples; they'll help you a lot) and display its content the way you want in a <table>.
User avatar
StathisG
Forum Newbie
 
Posts: 14
Joined: Sat Mar 13, 2010 8:15 pm
Location: UK

Re: Display array onto html table

Postby Shadowrider50 » Sun Feb 19, 2012 10:37 am

Hi,
Thanks for the answer,

i just read up on how to reference single elements from arrays and i've got it working now :)

I'm using it this way now

Syntax: [ Download ] [ Hide ]
$trophyplatinum = $getCount["0"][platinumtotal];


$getCount has the array stored of trophy information and i just store a single part of that array into $trophyplatinum.
I do the same for all other parts of the array.
This way i can use them anywhere easily by just calling that variable
Shadowrider50
Forum Newbie
 
Posts: 5
Joined: Sat Jan 28, 2012 4:00 am


Return to PHP - Code

Who is online

Users browsing this forum: Bing [Bot] and 15 guests