Releases: darkfriend/php5-xml
Releases · darkfriend/php5-xml
2.0.0
Changelog
- fixed bugs
- changed structure xml encode and decode
- added support duplicates elements
- added support prolog attributes and additional elements
- fixed attach elements
- support
encode->decode->encode
without changes
Migration to 2.x.x
- before
@cdata
, aftercdata
- before
@value
, aftervalue
- before
@namespace
, afternamespace
before encode
$array = array(
'bar' => 'value bar',
'foo' => 'value foo',
'der' => array(
'@cdata' => 'this is long text',
'@attributes' => array(
'at1' => 'at1val',
'at2' => 'at2val',
),
),
'qpo' => array(
'sub1' => array('sub2'=>'val')
)
);
after encode
$array = [
'bar' => 'value bar',
'foo' => 'value foo',
'der' => [
'cdata' => 'this is long text',
'@attributes' => [
'at1' => 'at1val',
'at2' => 'at2val',
],
],
'qpo' => [
'value' => [
'sub1' => [
'value' => [
'sub2'=>'val'
]
],
]
]
];
before decode
Array
(
[bar] => value bar
[foo] => value foo
[der] => Array
(
[@attributes] => Array
(
[at1] => at1val
[at2] => at2val
)
[@value] => this is long text
)
[qpo] => Array
(
[sub1] => Array
(
[sub2] => val
)
)
)
after decode
array(4) {
["bar"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
string(9) "value bar"
}
}
["foo"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
string(9) "value foo"
}
}
["der"]=>
array(1) {
[0]=>
array(2) {
["@attributes"]=>
array(2) {
["at1"]=>
string(6) "at1val"
["at2"]=>
string(6) "at2val"
}
["value"]=>
string(17) "this is long text"
}
}
["qpo"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
array(1) {
["sub1"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
array(1) {
["sub2"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
string(3) "val"
}
}
}
}
}
}
}
}
}
1.0.2
fixed parse child items
1.0.1
added customize <?xml?>
1.0.0
added Xml helper