[HELP] PHP Array help please!
3 posts
Page 1 of 1
here is the array
then i want to be able to display the [Key] => "value"
for example:
Code: Select all
now what i need is help fetching each array "[Key]" by itself.Array
(
[Protocol] => 17
[HostName] => Scottie's TFC Server
[Map] => epicenter
[ModDir] => tfc
[ModDesc] => Team Fortress Classic
[AppID] => 20
[Players] => 6
[MaxPlayers] => 16
[Bots] => 6
[Dedicated] => d
[Os] => w
[Password] => 1
[Secure] => 1
[Version] => 1.1.2.2
[GamePort] => 27015
)
then i want to be able to display the [Key] => "value"
for example:
Code: Select all
does this makes since?<div>HostName:
<?php
echo ["Key"] => "value";
?>
</div>
This code will declare an array with keys and then output each value and key:
Code: Select all
$arr = array(
"key1" => "value1",
"key2" => "value2"
);
while (list($key, $value) = each($arr))
{
echo "$key, $value\r\n";
}
not sure if i mis-lead you or not mandai.
LINK: http://scottie1972.dyndns.org/_tfc/_test/xPaw/
the array is already built. I need to know how to access it to display some of the data.
What i am trying to make is this:
this comes from GameTracker.com and I want to NOT use there banner.
I would like to make my own.
but i am having trouble with reading the array() from the link above.
the only information i really need is in the first array()
LINK: http://scottie1972.dyndns.org/_tfc/_test/xPaw/
the array is already built. I need to know how to access it to display some of the data.
What i am trying to make is this:
this comes from GameTracker.com and I want to NOT use there banner.
I would like to make my own.
but i am having trouble with reading the array() from the link above.
the only information i really need is in the first array()
Code: Select all
Array
(
[Protocol] => 17
[HostName] => [CNS] TFC Server
[Map] => crossover2
[ModDir] => tfc
[ModDesc] => Team Fortress Classic
[AppID] => 20
[Players] => 5
[MaxPlayers] => 16
[Bots] => 5
[Dedicated] => d
[Os] => w
[Password] => 1
[Secure] => 1
[Version] => 1.1.2.2
[GamePort] => 27015
)
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023