Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MioVisman/Parserus

Repository files navigation

Parserus

MIT licensed

BBCode parser.

Note

Version 1.x is incompatible with version 0.9.x.

Requirements

  • PHP 7.3.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.

About

BBCode parser

Topics

Resources

License

Stars

Watchers

Forks

Languages

AltStyle によって変換されたページ (->オリジナル) /