RE: [PHP] Everything between something becomes an array element
| From: | Christoph Starkmann | Date: | Mon, 05 Nov 2001 14:01:29 +0000 |
| Subject: | RE: [PHP] Everything between something becomes an array element | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73482@lists.php.net to get a copy of this message | ||
Hi there!
> Keep in mind that the first closing </tr> is where the search
> will stop so
>
> <tr><td><table><tr><td>foo</td><td>bar</td></tr></table></tr>
> will return :
>
> <tr><td><table><tr><td>foo</td><td>bar</td></tr>
Wouldn't it be smart to do a recursive extraction here? I have been
thinking about writing a smart little PHP-XML-Parser that is able
to distinguish multiple tags with the same name but a different
"parent"-tag, like
<entry>
<preview>
<source>[preview-source here]</source>
<width>[preview-width here]</width>
<height>[preview-height here]</height>
</preview>
<original>
<source>[original-source here]</source>
<width>[original-width here]</width>
<height>[original-height here]</height>
</original>
</entry>
If you simply scan these tags (like I did before using the
php-xml-functions :(, you cannot really distinguish the tags.
entry:preview:source and
entry:original:source etc.
should be stored (and therefor handled) differently and both
could be easily accessed.
Anybody got experiences with this kind of stuff? Sources? Ideas?
Thanks,
Kiko
-----
It's not a bug, it's a feature.
christoph starkmann
mailto:kiko@nfq.de
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-----