PHPackages                             codebrisk/bbcodeparser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. codebrisk/bbcodeparser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

codebrisk/bbcodeparser
======================

Parse your BBCode easy with this library.

v1.3(11y ago)027↓100%MITPHPPHP &gt;=5.3.0

Since Nov 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/CodeBrisk/BBCodeParser)[ Packagist](https://packagist.org/packages/codebrisk/bbcodeparser)[ Docs](http://github.com/golonka/bbcodeparser)[ RSS](/packages/codebrisk-bbcodeparser/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e53c4f9c168efa66c952de4eb852f5592d7d6e6065363db2b917a8a0738cf4e4/68747470733a2f2f7472617669732d63692e6f72672f676f6c6f6e6b612f4242436f64655061727365722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/golonka/BBCodeParser)

BBCodeParser
============

[](#bbcodeparser)

BBCodeParser is a standalone library that parses all(?) the common bbcode tags. The easiest way to install is via composer and is equally as easy to integrate into Laravel 4

The available tags are:

- \[b\]\[/b\] Bold
- \[i\]\[/i\] Italic
- \[u\]\[/u\] Underline
- \[s\]\[/s\] Line through
- \[size=4\]\[/size\] Font size
- \[color=#eee\]\[/color\] Font color
- \[center\]\[/center\] Center
- \[quote\]\[/quote\] Quote
- \[quote=John Doe\]\[/\] Named quote
- \[url\]\[/url\] Link
- \[url=[http://example.com\]example.com\[/url](http://example.com]example.com[/url)\] Named link
- \[img\][http://example.com\]example.com/logo.png\[/img\]](http://example.com%5Dexample.com/logo.png%5B/img%5D) Image
- \[list=1\]\[/list\] Ordered list (numerical)
- \[list=a\]\[/list\] Ordered list (alphabetically)
- \[list\]\[/list\] Unordered list
- \[\*\] List item
- \[code\]\[/code\] Code
- \[youtube\]\[/youtube\] Youtube

Installation
------------

[](#installation)

The easiest way to install the BBCodeParser library is via composer. If you don´t now what composer is or how you use it you can find more information about that at [their website](http://www.getcomposer.org/).

### Composer

[](#composer)

You can find the BBCodeParser class via [Packagist](https://packagist.org/packages/golonka/bbcodeparser). Require the package in your `composer.json` file.

```
"golonka/bbcodeparser": "1.3"

```

Then you run install or update to download your new requirement

```
php composer.phar install

```

or

```
php composer.phar update

```

Now you are able to require the vendor/autoload.php file to PSR-0 autoload the library.

### Example

[](#example)

```
// include composer autoload
require 'vendor/autoload.php';

// import the BBCodeParser Class
use Golonka\BBCode\BBCodeParser;

// Lets parse!
$bbcode = new BBCodeParser;
$bbcode->parse('[b]Bold[/b]'); // Bold

```

If you´re a fan of Laravel 4 then the integration is made in a blink of an eye. We will go through how that is done below.

Laravel 4 integration
---------------------

[](#laravel-4-integration)

The BBCodeParser Class has optional Laravel 4 support and comes with a Service Provider and Facades for easy integration. After you have done the installation correctly, just follow the instructions.

Open your Laravel config file config/app.php and add the following lines.

In the `$providers ` array add the service providers for this package.

```
'Golonka\BBCode\BBCodeParserServiceProvider'

```

Add the facade of this package to the `$aliases` array.

```
'BBCode' => 'Golonka\BBCode\Facades\BBCodeParser'

```

Now the BBCodeParser Class will be auto-loaded by Laravel.

### Example

[](#example-1)

By default all tags will be parsed

```
BBCode::parse('[b]bold[/b][i]italic[/i]');

```

If you would like to use only some tags when you parse you can do that by doing like this

```
// In this case the [i][/i] tag will not be parsed
BBCode::only('bold')->parse('[b]bold[/b][i]italic[/i]');

```

or

```
// In this case all tags except [b][/b] will be parsed
BBCode::except('bold')->parse('[b]bold[/b][i]italic[/i]');

```

Custom Parsers
--------------

[](#custom-parsers)

You can add new custom parsers or overwrite existing parsers.

```
// name, pattern, replace
BBCode::setParser('mailurl', '/\[mailurl\](.*)\[\/mailurl\]/', '$1');

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 59.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~24 days

Total

7

Last Release

4340d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/617985e7147e9ef566b611334a06817c9605964dbd05aeef8b406b8b046b693e?d=identicon)[codebrisk](/maintainers/codebrisk)

---

Top Contributors

[![juiceland](https://avatars.githubusercontent.com/u/1449819?v=4)](https://github.com/juiceland "juiceland (19 commits)")[![zwacky](https://avatars.githubusercontent.com/u/1093032?v=4)](https://github.com/zwacky "zwacky (7 commits)")[![yuri-moens](https://avatars.githubusercontent.com/u/1128153?v=4)](https://github.com/yuri-moens "yuri-moens (5 commits)")[![RizwanAslam](https://avatars.githubusercontent.com/u/11913234?v=4)](https://github.com/RizwanAslam "RizwanAslam (1 commits)")

---

Tags

laravelparserbbcode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codebrisk-bbcodeparser/health.svg)

```
[![Health](https://phpackages.com/badges/codebrisk-bbcodeparser/health.svg)](https://phpackages.com/packages/codebrisk-bbcodeparser)
```

###  Alternatives

[pherum/laravel-bbcode

Parse your BBCode easy with this library.

2427.5k](/packages/pherum-laravel-bbcode)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
