PHP code example of fuko-php / source

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

    

fuko-php / source example snippets




$source = new \Fuko\Source\Code('/var/www/html/index.php');
print_r($source->getLinesAt(17));
/*
Array
(
    [14] => Illuminate\Support\ClassLoader::register();
    [15] => Illuminate\Support\ClassLoader::addDirectories(array(CLASS_DIR,CONTROLLERS,CONTROLLERS.'Middleware/', MODELS, CONTROLLERS.'Admin/'));
    [16] =>
    [17] => $FileLoader = new FileLoader(new Filesystem,  RESOURCES.'lang');
    [18] => $translator = new Translator($FileLoader, 'en');
    [19] => $Container = new Container();
    [20] => $validation = new Factory($translator, $Container);
)
*/




$source = new \Fuko\Source\Code('/var/www/html/index.php');
print_r($source->getLinesAt(17, 1));
/*
Array
(
    [17] => $FileLoader = new FileLoader(new Filesystem,  RESOURCES.'lang');
)
*/