PHP code example of whotrades / formatter

1. Go to this page and download the library: Download whotrades/formatter 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/ */

    

whotrades / formatter example snippets


var_dump($format->getFormatName());

var_dump($format->getValueListByXPathList(["//node2", "//node3"]));

var_dump($format->getAsArray());

array (size=1)
  'root' => 
    array (size=3)
      'node1' => 
        array (size=2)
          0 => string 'text1' (length=5)
          1 => string 'text2' (length=5)
      'node2' => string 'text3' (length=5)
      'node3' => 
        array (size=2)
          0 => string 'text4' (length=5)
          1 => string 'text5' (length=5)

var_dump($format->getFormatted());