.. | ||
composer.json | ||
LICENSE | ||
Parserus.php | ||
README.md |
Parserus
BBCode parser.
Requirements
- PHP 5.4.0
Installation
Include Parserus.php
or install the composer package.
Example
$parser = new Parserus();
echo $parser->addBBCode([
'tag' => 'b',
'handler' => function($body) {
return '<b>' . $body . '</b>';
}
])->addBBcode([
'tag' => 'i',
'handler' => function($body) {
return '<i>' . $body . '</i>';
},
])->parse("[i]Hello\n[b]World[/b]![/i]")
->getHTML();
#output: <i>Hello<br><b>World</b>!</i>
More examples in the wiki.
License
This project is under MIT license. Please see the license file for details.