PHP code example of kukulich / fshl

1. Go to this page and download the library: Download kukulich/fshl 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/ */

    

kukulich / fshl example snippets


	
	$highlighter = new \FSHL\Highlighter(new \FSHL\Output\Html());
	$highlighter->setLexer(new \FSHL\Lexer\Php());
	echo '<pre>';
	echo $highlighter->highlight(' echo "Hello world!"; 

	
	$highlighter = new \FSHL\Highlighter(new \FSHL\Output\Html(), \FSHL\Highlighter::OPTION_TAB_INDENT | \FSHL\Highlighter::OPTION_LINE_COUNTER);
	echo '<pre>';
	echo $highlighter->highlight(' echo "Hello world!";