Skip to main content

"Black Friday" Discount! Only until December 1st: 50% off all membership plans!

Read more here
Back to packages
382 GitHub stars

phikiphp/phiki

View on GitHub

Description

Syntax highlighting powered by TextMate grammars in PHP.

1. Install Phiki

composer require phiki/phiki:^2.0

2. Create a new Phiki instance

use Phiki\Phiki;
 
$phiki = new Phiki();

3. Highlight your code

use Phiki\Grammar\Grammar;
use Phiki\Theme\Theme;
 
$code = file_get_contents('path/to/your/code.php');
$highlighted = $phiki->codeToHtml($code, Grammar::Php, Theme::GithubLight);
 
echo $highlighted;

Recent Courses on Laravel Daily

Laravel Boost: Deeper Practical Dive

8 lessons
32 min

Marketing for Developers in 2026

7 lessons
52 min

Next.js Basics for Laravel Developers

11 lessons
58 min