phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] xml to array


From: Dan Kuykendall
Subject: Re: [Phpgroupware-developers] xml to array
Date: Sun, 28 Mar 2004 12:54:17 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4

There should also be a function called xml2var() and var2xml() which could be used like this:

$xmldata = file_get_contents($file);
$var_result = xml2var($xmldata);

These functions are basicly just exactly what you did, but put into a simple function.

Dan

Sigurd Nes wrote:

Thanks – that worked great!
I had to use the HEAD-version because of safe_args issues.
Here is how:

$xmltool = CreateObject('phpgwapi.xmltool');
$file= ...
$xmldata = file_get_contents($file);
$xmltool->import_xml($xmldata);
$var_result = $xmltool->export_var();

Sigurd

Dan Kuykendall wrote:

Look at xmltool.
There is a version in the HEAD code as well as an improved one in the proposal-branch/nextgen codebase. I suggest using the nextgen version. I put very little code that is not generic, and that was just for error handling.

xmltool is able to convert any xml to an array, and any array into an xml.

Dan


Sigurd Nes wrote:

Does someone have an advice on how to read a xml-document into an array ?

Sigurd


_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/phpgroupware-developers




_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/phpgroupware-developers






_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/phpgroupware-developers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]