here is how I am currently going at it...
$users = "user1\;user2\;user3\;";
$dom = new DOMDocument();
$dom->load("http://api.ustream.tv/ust_api.xml/channel/".$users."/getInfo?key=myApiKey");
foreach ($dom->getElementsByTagname('result') as $element) {
$status = $element->getAttribute('status');
foreach (($element->childNodes) as $e) {
if (is_a($e, 'DOMElement')) {
if ($e->tagName == 'title') {
$titlez = htmlspecialchars($e->textContent);
} elseif ($e->tagName == 'status') {
$onornot = htmlspecialchars($e->textContent);
}
}
}
}
echo($onornot);
in the above example, it will grab the XML - and return with a table for user1,2,3 - the problem I am having is printing each ones results out because the usernames aren't static (they're dynamic)...
so i cant just hard code user1,2,3,4,etc. because when a user would sign up, they'd not be in the code.. I want a way for it to seperate each user inside the variable(much like an array), and have the option to parse the XML for each variable in the array.. However, I've had no luck with arrays because if i try to print them all out it will spit out:
Array ( [0] => Array ( [0] => user1 [1] => user2 [2] => user3 ) )
I'm just at a lost on how I can store these variables, easily call them and attach them to an XML request, and then use the variables to organize the XML document....
btw, the array code I used is:
$theVariable = array("users" =>
array (
0=> "neggy\;",
1=> "blindz0r\;",
2=> "vixenita\;"),
);
print_r(array_values($theVariable));