PHP code example of voku / ansi-to-html

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

    

voku / ansi-to-html example snippets




use voku\AnsiConverter\AnsiToHtmlConverter;

$converter = new AnsiToHtmlConverter();

$html = $converter->convert($ansi);

use voku\AnsiConverter\Theme\SolarizedTheme;

$theme = new SolarizedTheme();
$converter = new AnsiToHtmlConverter($theme);

$converter = new AnsiToHtmlConverter($theme, false);

$styles = $theme->asCss();
html+php
<html>
    <head>
        <style>
             echo $styles