PHPackages                             golonka/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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. golonka/bbcodeparser

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

golonka/bbcodeparser
====================

Parse your BBCode easy with this library.

v3.0(6y ago)146.1k↓40%1[1 PRs](https://github.com/juiceland/BBCodeParser/pulls)1MITPHPPHP &gt;=7.2.0CI passing

Since Nov 7Pushed 3mo ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (17)Used By (1)

[![Latest Version](https://camo.githubusercontent.com/c54a4f8035787852120479b0b102a6cbe9c35b6836bfd01e2fd64e5c5a76715d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6a756963656c616e642f6262636f64657061727365722e7376673f7374796c653d666c61742d737175617265)](https://github.com/juiceland/bbcodeparser/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/9768920e0a2d1aa19c2db5f61fb4edf00d4f6436d26aad5a7240d94ac9497c86/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a756963656c616e642f4242436f64655061727365722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/juiceland/BBCodeParser)[![Total Downloads](https://camo.githubusercontent.com/746374bc09d0060b4dcdbd07b7ec108f8f7035a9efef53788d59f6932e27971c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f6c6f6e6b612f6262636f64657061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/golonka/bbcodeparser)

The `Golonka\BBCodeParser` package will help you with parsing BBCode.

Install
-------

[](#install)

Via Composer

```
$ composer require golonka/bbcodeparser
```

Usage
-----

[](#usage)

To parse some text it's as easy as this!

```
$bbcode = new Golonka\BBCode\BBCodeParser;

echo $bbcode->parse('[b]Bold Text![/b]');
// Bold Text!
```

Would like the parser to not use all bbcodes? Just do like this.

```
$bbcode = new Golonka\BBCode\BBCodeParser;

echo $bbcode->only('bold', 'italic')
            ->parse('[b][u]Bold[/u] [i]Italic[/i]![/b]');
            // [u]Bold[/u] Italic!

echo $bbcode->except('bold')
            ->parse('[b]Bold[/b] [i]Italic[/i]');
            // [b]Bold[/b] Italic
```

By default the parser is case sensitive. But if you would like the parser to accept tags like `[B]Bold Text[/B]` it's really easy.

```
$bbcode = new Golonka\BBCode\BBCodeParser;

// Case insensitive
echo $bbcode->parse('[b]Bold[/b] [I]Italic![/I]', true);
     // Bold Italic!

// Or like this

echo $bbcode->parseCaseInsensitive('[b]Bold[/b] [i]Italic[/i]');
     // Bold Italic!
```

You could also make it more explicit that the parser is case sensitive by using another helper function.

```
    $bbcode = new Golonka\BBCode\BBCodeParser;

    echo $bbcode->parseCaseSensitive('[b]Bold[/b] [I]Italic![/I]');
         // Bold [I]Italic![/I]
```

If you would like to completely remove all BBCode it's just one function call away.

```
    $bbcode = new Golonka\BBCode\BBCodeParser;

    echo $bbcode->stripBBCodeTags('[b]Bold[/b] [i]Italic![/i]');
         // Bold Italic!
```

Laravel integration
-------------------

[](#laravel-integration)

The integration into Laravel is really easy, and the method is the same for both Laravel 4 and Laravel 5. Just open your `app.php` config file.

In there you just add this to your providers array

```
'Golonka\BBCode\BBCodeParserServiceProvider'
```

And this to your facades array

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

The syntax is the same as if you would use it in vanilla PHP but with the `BBCode::` before the methods. Here are some examples.

```
// Simple parsing
echo BBCode::parse('[b]Bold Text![/b]');

// Limiting the parsers with the only method
echo BBCode::only('bold', 'italic')
        ->parse('[b][u]Bold[/u] [i]Italic[/i]![/b]');
        // [u]Bold[/u] Italic!

// Or the except method
echo BBCode::except('bold')
        ->parse('[b]Bold[/b] [i]Italic[/i]');
        // [b]Bold[/b] Italic
```

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Joseph Landberg](https://github.com/golonka)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance53

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 78.1% 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 ~149 days

Recently: every ~355 days

Total

15

Last Release

2484d ago

Major Versions

v1.4 → v2.0.02015-06-02

v2.3 → v3.02019-07-30

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.4.0

v3.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfe8403460e749c90a80920691b1f777ef9f0f5a432f675ada4196eae9648264?d=identicon)[golonka](/maintainers/golonka)

---

Top Contributors

[![juiceland](https://avatars.githubusercontent.com/u/1449819?v=4)](https://github.com/juiceland "juiceland (82 commits)")[![zwacky](https://avatars.githubusercontent.com/u/1093032?v=4)](https://github.com/zwacky "zwacky (7 commits)")[![dandersson](https://avatars.githubusercontent.com/u/3901008?v=4)](https://github.com/dandersson "dandersson (6 commits)")[![yuri-moens](https://avatars.githubusercontent.com/u/1128153?v=4)](https://github.com/yuri-moens "yuri-moens (5 commits)")[![abixalmon](https://avatars.githubusercontent.com/u/1712938?v=4)](https://github.com/abixalmon "abixalmon (3 commits)")[![Colbydude](https://avatars.githubusercontent.com/u/575593?v=4)](https://github.com/Colbydude "Colbydude (1 commits)")[![MAH1987](https://avatars.githubusercontent.com/u/1618102?v=4)](https://github.com/MAH1987 "MAH1987 (1 commits)")

---

Tags

laravelparserPSR-4PSR-2PHP7bbcodePSR-1

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[genert/bbcode

BBCode parser from or to HTML.

81324.0k1](/packages/genert-bbcode)[icamys/php-sitemap-generator

Simple PHP sitemap generator.

175342.8k6](/packages/icamys-php-sitemap-generator)[evilfreelancer/routeros-api-php

Modern Mikrotik RouterOS API PHP client for your applications (with Laravel support)

491206.1k4](/packages/evilfreelancer-routeros-api-php)[authbucket/oauth2-php

The standard compliant OAuth2.0 library based on the Symfony Components

82107.6k4](/packages/authbucket-oauth2-php)[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)
