PHP code example of offline / laravel-local-cache

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

    

offline / laravel-local-cache example snippets


$string = '<p>http://www.offlinegmbh.ch/file.jpg</p><p>http://www.offlinegmbh.ch/file2.jpg</p>';
    
// <p>http://yoursite/cache/{hash1}</p><p>http://yoursite/cache/{hash2}</p>
var_dump(LocalCache::getCachedHtml($string));

$string = '<p>@http://dont-cache-me/file.jpg</p>';
// <p>http://dont-cache-me/file.jpg</p>
var_dump(LocalCache::getCachedHtml($string));

$string = 'http://www.offlinegmbh.ch/file.jpg';
    
// returns http://yoursite/cache/{hash}
var_dump(LocalCache::getCachedHtml($string));