Re: Planning to create Array -> XML extension
| From: | Alexey Zakhlestin | Date: | Mon, 14 Jul 2008 20:04:44 +0000 |
| Subject: | Re: Planning to create Array -> XML extension | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-5616@lists.php.net to get a copy of this message | ||
Hi, Dmitry.
On Mon, Jul 14, 2008 at 11:55 PM, Dmitry Koterov <dmitry@koterov.ru> wrote:
> Hello.
>
> I am planning to create a PECL extension which converts multi-dimensional
> (nested) PHP arrays into an XML document.
> E.g., array('a' => array('b' => 'c')) becomes
> <a><b>c</b></a>.
>
> The main goal is to speedup this transformation greatly.
>
> Please say is there any similar extension (possibly not in PECL itself, but
> somewhere) available?
> Possibly I am planning to "contrive a bicycle"?
The closest thing in "xml-world" is XMLWriter, I guess. So, the answer
to your question is "no, there is no extension which does exactly
that"
On the other hand, if you need cross-platform data-exchange format,
which is not necessarily XML, I may suggest YAML as alternative.
PHP extension for YAML is here: http://pecl.php.net/package/syck
serialization is as simple as:
$string = syck_dump($array_or_anything_else);
and retrieving:
$array_or_anything_else = syck_load($string);
--
Alexey Zakhlestin
http://blog.milkfarmsoft.com/