PHP code example of susros / colorbarcoder

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

    

susros / colorbarcoder example snippets



use ColorbarCoder\ColorbarCoder;

$colorbarCoder = new ColorbarCoder();

// Original text 
$text = "This is awesome!"; 

// Encode the text
$colorbarCoder->encode($text);

$colorbarCoder->printColorbarImage(500, 500);

// Image file
$image = "./img/colorbar.png";

// Decode the image
$colorbarCoder->decode($image);

echo $colorbarCoder->getText();