GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - chillerlan/php-bbcode: A recursive regexp BBCode parser for PHP 7+

BranchesTags
Open more actions menu

Latest commit

 

History

244 Commits
244 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
.scrutinizer.yml
.scrutinizer.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
nope.travis.yml
nope.travis.yml
 
 
phpmd.xml
phpmd.xml
 
 
phpunit.xml
phpunit.xml
 
 

Repository files navigation

chillerlan/php-bbcode

A recursive regexp BBCode parser for PHP 7+ using preg_replace_callback(), based on an example by MrNiceGuy on developers-guide.net. Handles nested tags as well as matching brackets and doesn't stumble across invalid tags.

version license Travis Coverage Scrunitizer Packagist downloads PayPal donate

Requirements

  • PHP 7.2+

Documentation

Installation

requires composer

composer.json

(note: replace dev-master with a version boundary)

{
	"require": {
		"php": ">=7.2.0",
		"chillerlan/php-bbcode": "dev-master"
	}
}

Manual installation

Download the desired version of the package from master or release and extract the contents to your project folder. After that:

  • run composer install to install the required dependencies and generate /vendor/autoload.php.
  • if you use a custom autoloader, point the namespace chillerlan\BBCode to the folder src of the package

Profit!

Usage

  • @todo

For an implementation example see the GWBBCoder over here: gw1-database/GWBBCode.

Language

  • @todo

Notes

The parser may cause some high CPU load, depending on the input. You should never consider to use it somewhere in your output subsystem - encode on input - you'll want a preview anyway. ;)

You may also run into several bugs. In fact, the BBCoder is essentially a tool to squeeze out any PCRE related bug in PHP known to man (and perhaps unknown). Have fun! ;) It is highly recommended to use these php.ini settings, especially to disable the PCRE JIT in PHP7 which is a troublemaker. In case you happen to run into a PCRE related bug, i ask you to open an issue over here along with the bbcode which caused the error and further information.

Disclaimer!

I don't take responsibility for molten CPUs, smashed keyboards, broken HTML etc.. Use at your own risk!

About

A recursive regexp BBCode parser for PHP 7+

Topics

bbcodebbcode-parserhtml5markdownphpphp-libraryphp7

Resources

Readme
MIT license
Activity
Custom properties

Stars

4 stars

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.