final class \SmartXmlComposer
{
} ->
- Language: PHP
- Located at: lib/framework/plugins/lib_xml.php
- Package: Plugins:ConvertersAndParsers
- Namespace: \
- Class Name: SmartXmlComposer
- Version: v.20221220
- Depends: classes: Smart
- Hints: -
- Usage: dynamic object: (new Class())->method() - This class provides only DYNAMIC methods
public function __construct (
$encoding = ""
) {} @
public function transform (
array $y_array,
$xmlroot = "xml"
) {} ->
<?php
//-- Sample use:
$array = array(
'id' => '15',
'name' => 'Test',
'data' => array(
'key1' => '12345',
'key2' => '67890',
'key3' => 'ABCDEF'
),
'date' => '2016-02-05 09:30:05'
);
$xml = (new SmartXmlComposer())->transform($array, 'myxml');
echo $xml;
//-- will have something like:
<myxml>
<id>15</id>
<name>Test</name>
<data>
<key1>12345</key1>
<key2>67890</key2>
<key3>ABCDEF</key3>
</data>
<date>2016-02-05 09:30:05</date>
</myxml>
//--
// #end php code
documentation generated on: 2023-10-19 23:15:45 +0000
Smart.Framework © 2009-2023 unix-world.org
XML tag attributes are not supported.