PHP

Markdown libraries for PHP, from a fully extensible parser to tiny single-file options. Back to the overview.

league/commonmark

A highly extensible, CommonMark- and GFM-compliant parser by The PHP League; used by Laravel.

CommonMarkGFM
use League\CommonMark\CommonMarkConverter;

$converter = new CommonMarkConverter();
echo $converter->convert('# Hello *world*');

View league/commonmark →

Parsedown

A single-file, dependency-free parser that is fast and simple to drop in.

lightweight
$Parsedown = new Parsedown();
echo $Parsedown->text('# Hello *world*');

View Parsedown →

taufik-nurrohman/markdown

A CommonMark 0.31.2 parser that is 99% compliant. Install with Composer or drop in the single file for a dependency-free parser.

CommonMarklightweight
use function x\markdown\from;

require 'vendor/autoload.php';

echo from('# Hello *world*');

View taufik-nurrohman/markdown →

Your PHP library not listed? Let us know.