PHP code example of permafrost-dev / code-snippets
1. Go to this page and download the library: Download permafrost-dev/code-snippets library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
permafrost-dev / code-snippets example snippets
use Permafrost\CodeSnippets\CodeSnippet;
$snippet = (new CodeSnippet())
->surroundingLine(4)
->snippetLineCount(6)
->fromFile('/path/to/a/file.php');
$snippet = (new CodeSnippet())
->surroundingLines(4, 7)
->snippetLineCount(6)
->fromFile('/path/to/a/file.php');
// the "target" line isn't displayed in the middle, but as the second line
$snippet = (new CodeSnippet())
->surroundingLine(4)
->linesBefore(1)
->linesAfter(3)
->fromFile('/path/to/a/file.php');