Skip to content

Commit

Permalink
chore: add example script
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Dec 21, 2019
1 parent e14ede6 commit c2c8808
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

use Ahc\CliSyntax\Highlighter;

require_once __DIR__ . '/src/Highlighter.php';

// Highlight code
echo (new Highlighter("<?php echo 'Hello world!'; ?>\n"))->highlight();

// Highlight file
echo Highlighter::for(__FILE__)->highlight();

// Magic string works too:
// echo new Highlighter('<?php echo "Hello world!";');
// echo Highlighter::for(__FILE__);

0 comments on commit c2c8808

Please sign in to comment.