Re: Config::parseConfig()
| From: | Bertrand Mansion | Date: | Wed, 14 Apr 2004 21:18:19 +0000 |
| Subject: | Re: Config::parseConfig() | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11845@lists.php.net to get a copy of this message | ||
<paul@foundryzero.com> wrote :
>
> Hey PEAR people,
> I want to instantiate Config and use the parseConfig() method to take
> some XML (which was created with Config) and turn it into an array with
> toArray(). The XML data isn't in a file, I've got it in a string.
> The parseConfig() method expects a file path as it's first argument
> when you're using the XML datasource type, and I don't see any obvious
> way of getting Config to just use my string. Anybody run into this
> before me? Am I missing something?
Hi,
$conf = new Config();
$root =& $conf->parseConfig($xml, 'xml', array('isFile' => false));
Should do.
Bertrand Mansion
Mamasam