PHP code example of rumd3x / php-brainfuck

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

    

rumd3x / php-brainfuck example snippets


use Rumd3x\Brainfuck\Brainfuck;

echo Brainfuck::encode("Hello World!"); 
// outputs: ++++++++++[>+++++++>++++++++++>+++++++++++>+++++++++++>+++++++++++>+++>+++++++++>+++++++++++>+++++++++++>+++++++++++>++++++++++>+++<<<<<<<<<<<<-]>++.>+.>--.>--.>+.>++.>---.>+.>++++.>--.>.>+++.

use Rumd3x\Brainfuck\Brainfuck;

echo Brainfuck::encode("Some ASCII: ABC+ŤĎ and some non-ASCII: Ąąśćł.'", true); // will replace non-ascii with their ascii counterpart 
echo Brainfuck::encode("Prettifying'", false, true); // will output pretty printed brainfuck code

use Rumd3x\Brainfuck\Brainfuck;

echo Brainfuck::decode("++++++++++[>+++++++>++++++++++>+++++++++++>+++++++++++>+++++++++++>+++>+++++++++>+++++++++++>+++++++++++>+++++++++++>++++++++++>+++<<<<<<<<<<<<-]>++.>+.>--.>--.>+.>++.>---.>+.>++++.>--.>.>+++."); 
// outputs: Hello World!