PHP code example of aydin-hassan / xml-fuse

1. Go to this page and download the library: Download aydin-hassan/xml-fuse library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aydin-hassan / xml-fuse example snippets


array(2) {
  [0] =>
  array(5) {
    'orderId' => string(2) "01"
    'customerEmail' => string(19) "[email protected]"
    'id' => string(1) "1"
    'qty' => string(1) "2"
    'status' => string(10) "despatched"
  }
  [1] =>
  array(5) {
    'orderId' => string(2) "01"
    'customerEmail' => string(19) "[email protected]"
    'id' => string(1) "5"
    'qty' => string(1) "1"
    'status' => string(10) "despatched"
  }
}

$xml = '<?xml version="1.0" encoding="ISO-8859-1"

[
   'orderId' => 1,
   'customerEmail' => '[email protected]',
]

[
   'id' => '1',
   'qty' => '1',
   'status' => 'despatched',
]

[
   'orderId' => 1,
   'customerEmail' => '[email protected]',
   'id' => '1',
   'qty' => '1',
   'status' => 'despatched',
]