PHP code example of lfbn / file-get-contents-proxy

1. Go to this page and download the library: Download lfbn/file-get-contents-proxy 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/ */

    

lfbn / file-get-contents-proxy example snippets




$content = file_get_contents('some-file-name.txt');




use FileGetContentsProxy\FileGetContentsProxy;

$fileProxy = new FileGetContentsProxy('some-file-name.txt');

// It will be obtained from the file, and then, saved in memory.
$content = $fileProxy->memoryCacheGet();

// It will be obtained from the memory cache.
$cachedContent = $fileProxy->memoryCacheGet();




$newContent = $fileProxy->directGet();