- json_decode: documentation ( source)
- simplexml_load_string: documentation ( source)
- print_r: documentation ( source)
- json_encode: documentation ( source)
<?php
$foo = '<?xml version="1.0" encoding="UTF-8"?>
<response response_code="0">
<initial_orders initial_order_total_price="2.3958">
<initial_order article_group_name="Conjunto de prueba 1">
<initial_order_lines>
<initial_order_line article_cn6="123456" article_description="ArtÃculo de prueba 1" article_pvl="1" article_initial_order_units="1" article_discount="1"/>
<initial_order_line article_cn6="123457" article_description="ArtÃculo de prueba 2" article_pvl="1" article_initial_order_units="1" article_discount="1"/>
</initial_order_lines>
</initial_order>
</initial_orders>
</response>';
$bar = simplexml_load_string($foo);
$bax = json_encode($bar);
$baz = json_decode($bax, true);
print_r($baz['initial_orders']['initial_order']);