PHP code example of arabcoders / bbcode

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

    

arabcoders / bbcode example snippets




$bbcode = new \arabcoders\bbcode\BBCode();

$bbcode->registerFilters( [
    ( new \arabcoders\bbcode\Filters\Text() )->getFilter(),
    ( new \arabcoders\bbcode\Filters\Table() )->getFilter()
] );

echo $bbcode->parse( 'test [b]bold[/b] string' );


$bbcode = new \arabcoders\bbcode\BBCode();

// array with all filters.
$bbcode->registerFilters( [] );

// register single filter.
$bbcode->registerFilter( 'name', 'regex', function(){} );