PHPackages                             weiloon1234/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. weiloon1234/bbcodeparser

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

weiloon1234/bbcodeparser
========================

Parse your BBCode easy with this library.

1.0.0(8y ago)01.0kMITPHPPHP &gt;=5.4.0

Since Mar 2Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/weiloon1234/bbcodeparser)[ Packagist](https://packagist.org/packages/weiloon1234/bbcodeparser)[ Docs](http://github.com/weiloon1234/bbcodeparser)[ RSS](/packages/weiloon1234-bbcodeparser/feed)WikiDiscussions master Synced 3d ago

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

[![Latest Version](https://camo.githubusercontent.com/5b8b7253764f365acb4929dc2f09c778e99eeb20bfa3f2bf9425f8738bfd13f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7765696c6f6f6e313233342f6262636f64657061727365722e7376673f7374796c653d666c61742d737175617265)](https://github.com/weiloon1234/bbcodeparser/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/51acea95069a11fc18675c7813b26903c726b8aba27758d74eda703a762b2bc9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7765696c6f6f6e313233342f4242436f64655061727365722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/weiloon1234/BBCodeParser)[![Coverage Status](https://camo.githubusercontent.com/66c10795b22fe00977c99108f69c0522bab3fdcb768f9257ab74739594cc6626/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7765696c6f6f6e313233342f6262636f64657061727365722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/weiloon1234/bbcodeparser/code-structure)[![Quality Score](https://camo.githubusercontent.com/cd510c4dd1426b77224af044b77a7aa708a231acfc75794dce11fcba1360a501/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7765696c6f6f6e313233342f6262636f64657061727365722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/weiloon1234/bbcodeparser)[![Total Downloads](https://camo.githubusercontent.com/67cdae3a3b94c6859b10a7028220b930fba5f601d994f54731f99a6cec17fa19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7765696c6f6f6e313233342f6262636f64657061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/weiloon1234/bbcodeparser)

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

Install
-------

[](#install)

Via Composer

```
$ composer require weiloon1234/bbcodeparser
```

Usage
-----

[](#usage)

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

```
$bbcode = new Weiloon1234\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 Weiloon1234\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 Weiloon1234\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 Weiloon1234\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 Weiloon1234\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

```
'Weiloon1234\BBCode\BBCodeParserServiceProvider'
```

And this to your facades array

```
'BBCode' => 'Weiloon1234\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

32

—

LowBetter than 72% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2996d ago

### Community

Maintainers

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

---

Top Contributors

[![weiloon1234](https://avatars.githubusercontent.com/u/7457342?v=4)](https://github.com/weiloon1234 "weiloon1234 (13 commits)")

---

Tags

laravelparserPSR-4PSR-2bbcodePSR-1

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/weiloon1234-bbcodeparser/health.svg)](https://phpackages.com/packages/weiloon1234-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)
