PHP code example of syrian-lucianos / base16-php

1. Go to this page and download the library: Download syrian-lucianos/base16-php 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/ */

    

syrian-lucianos / base16-php example snippets


$text = "Hello World!, This is a test.";
$encoded = base16_encode($text); 
echo $encoded . PHP_EOL;  // Output "48656c6c6f20576f726c64212c2054686973206973206120746573742e"
$decoded = base16_decode($encoded); 
echo $decoded . PHP_EOL;  // Output "Hello World!, This is a test."

$text = "Hello World!, This is a test.";
$encoded = Base16::Encode($text); 
echo $encoded . PHP_EOL;  // Output "48656c6c6f20576f726c64212c2054686973206973206120746573742e"
$decoded = Base16::Decode($encoded); 
echo $decoded . PHP_EOL;  // Output "Hello World!, This is a test."