Re: Re: Sorting parsed XML
| From: | @ Edwin | Date: | Mon, 25 Nov 2002 15:49:53 +0000 |
| Subject: | Re: Re: Sorting parsed XML | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125948@lists.php.net to get a copy of this message | ||
Hello,
"Chris" <cgoodno@comcast.net> wrote:
> I'm trying to write PHP code that will not only parse the XML but also
> allow me to sort the parsed information by the values parsed.
I'm not sure if I really understand but let me try...
...[snip code]...
Adding echo '<table border="1">'; before this and
> $xml_parser = xml_parser_create();
...[snip code]...
after this
> xml_parser_free($xml_parser);
echo '</table>';
shows a good view that you have a table with two columns.
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:
http://www.php.net/manual/en/ref.array.php
HTH,
- E
...[snip]...