PHP code example of perf / source

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

    

perf / source example snippets




$path = '/foo/bar/settings.ini';

$source = \perf\Source\LocalFileSource::create($path);

function print_content(\perf\Source\Source $source)
{
	echo $source->getContent();
}



$string = 'foo = bar';

$source = \perf\Source\StringSource::create($string);

function print_content(\perf\Source\Source $source)
{
	echo $source->getContent();
}