PHP code example of rodnaph / edhen

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

    

rodnaph / edhen example snippets


$element = Edhen::decode('(1 :foo [2])');

// array(1, ':foo', array(2))

$elements = Edhen::decodeAll(':foo :bar :baz');

// array(':foo', ':bar', ':baz')

$ednString = Edhen::encode(array(1, 2));

// '[1 2]'

$myHandler = new MyCustomTagHandler();

$element = Edhen::decode($edn, array($myHandler));