arabcoders / bbcode
BBCode Package
v1.0.0
2016-07-21 18:18 UTC
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2024-12-23 07:28:48 UTC
README
Parse BBCode.
Install
Via Composer
$ composer require arabcoders/bbcode
Usage Example.
<?php $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' );
you can add the other filters as well, or create your own by regsitering them using one of the following methods.
<?php $bbcode = new \arabcoders\bbcode\BBCode(); // array with all filters. $bbcode->registerFilters( [] ); // register single filter. $bbcode->registerFilter( 'name', 'regex', function(){} );