Sunday, 8 September 2013

Stuck in setting values to arrays PHP

Stuck in setting values to arrays PHP

I've been reading about arrays in the PHP manual website, but it's very
confusing!
However, I managed to start something off:
$refarray = array("Test", "Test2");
//$online[];
//$names[];
foreach($refarray as $refarr)
{
$xml = simplexml_load_file("http://www.xfire.com/xml/$refarr/status");
//$online = $xml->status;
//$names = $xml->nickname;
}
I just can't figure out how to store 2 values "status" and "nickname" in
arrays so I can use them later on here:
//foreach($online as $on) Loop through the original array and echo its
values "status" and "nickname"
//{
// echo $online[$on];
// echo $names[$
//}

No comments:

Post a Comment