PHP code example of phuedx / tnetstring

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

    

phuedx / tnetstring example snippets




oad = array(
    'authors' => array(
        array(
            'name'     => 'Sam Smith',
            'email'    => '[email protected]',
            'homepage' => 'https://github.com/phuedx',
        ),
    ),
);

$codec = new \Phuedx\TNetstring\Codec();
$encoded = $codec->encode($payload);
$decoded = $codec->decode($encoded);

$encoded = tnetstring_encode($payload);
$decoded = tnetstring_decode($encoded);