Sorry, use to using to a listserv that auto-plants the listserv address,
not the responder's address on replies :P


> From: @ Edwin [mailto:[EMAIL PROTECTED]]
> If you'd like to sort these, then I think you might be able 
> to do something like this: 1. Instead of printf()'ing your 
> <td>'s or <tr>'s inside the class/function, why don't you try 
> "putting" it inside an array? (Maybe with array_push() or
> something.) Then,
> 2. If you already have an array, perhaps you can use one of 
> the functions here for sorting:


Aye, this is essentially what I need help with, is making the array.

What I'm looking for is a way to put the data into an array and then
sort it based on the user's want and then print it out in a table
format.

I've already got the xml info working as intended:

http://www.rpgtimes.com/daoc/

But what I've tried with getting the data placed into an array so far
hasn't worked.  Not many parsed XML examples out there or anything the
10 odd books I have help me with this.  Books, I've found, in general,
can't help me with most of my array needs due to their very basic
examples and descriptions.

I am about to try doing an array as such:

Instead of:

function serverData($parser, $data) {
        if ($this->insideitem) {
                switch ($this->tag) {
                        case "POPULATION":
                                $this->ServerPopulation .= $data;
                                break;
                        case "STATUS":
                                $this->ServerStatus .= $data;
                                break;
                }
        }
}

Something to this affect:

function serverData($parser, $data) {
        if ($this->insideitem) {
                switch ($this->tag) {
                        case "POPULATION":
        
$ServerArray[$this->ServerName][$this->ServerPopulation] = $data;
                                break;
                        case "STATUS":
        
$ServerArray[$this->ServerName][$this->ServerStatus]= $data;
                                break;
                }
        }
}

Course, I'm unsure how this will work (but I'll try it out) since
$this->ServerName may not carry to the $this->insideitem check.  I would
then plan to use function endElement to determine the user's want and
then print the HTML out based on that, such as wanting the current data
sorted by population (default) or by server name, type, or status.

Sorry, I'm new to dynamic web page creation and especially to XML, but
I've got a love for programming and a head that just wants to learn more
of it, so I create tons of web sites based around my hobbies so that I
can practice and learn more.  I'm glad I found this listserv and hope
you guys don't mind my questions.

Thanks for any help you can provide.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to