菜谱项目

snippet.php 300B

12345678910
  1. <?php
  2. use JakubOnderka\PhpConsoleColor\ConsoleColor;
  3. use JakubOnderka\PhpConsoleHighlighter\Highlighter;
  4. require __DIR__ . '/../vendor/autoload.php';
  5. $highlighter = new Highlighter(new ConsoleColor());
  6. $fileContent = file_get_contents(__FILE__);
  7. echo $highlighter->getCodeSnippet($fileContent, 3);