I've looked over all the old topics for arrays, looked in the docs but to no avail. Hope you guys can help.
I play a game called Dark Age of Camelot, it's a massive online rpg, like EverQuest and Ultima Online. The neat thing is that they output the player database to an xml file which you can then parse to put on your website. So what I'm looking to do is parse a file to get $guildname and $guildxml (which is the code for the $guildxml.xml file on the game server).
No problems on the parsing. I want to put the parsed ALGUILDID into the array $guildxml. To test if that is working properly, I've made it so that it outputs to a page with the $guildname and $guildid showing. Below is part of the code I use
$guildxml = array();
function characterData($parser, $data) {
global $insideitem, $tag, $guildname, $guildxml;
if ($insideitem) {
switch ($tag) {
case "ALNAME": $guildname .=$data;break;
case "ALGUILDID": $guildxml[] .=$data;break;
}
}
}
function endElement($parser, $tagName) {
global $insideitem, $tag, $guildxml, $guildname;
if ($tagName == "ALLIANCEMEMBER") {
print "$guildname";
print "$guildxml<BR>";
$guildname= "";
$insideitem = false;
}
}
Now instead of printing the actual values inside the $guildxml array, it simply prints "Array" behind each of the guildnames like so:
Ice Dragons [Leader] Array
Defenders Of The Crown Array
Flemish Mayhem Array
Forsaken Array
Knights of Siegehammer Array
Knights of Valor Array
Paradox Array
Resolution Array
Sauvage Guard Array
Shining Force Array
Southern Cross Array
The Chosen Ones Array
What am I doing wrong here? How do I get it to print the actual values of the array rather than the type of the variable?