PHP code example of alejodaraio / cloudflare-purgefile
1. Go to this page and download the library: Download alejodaraio/cloudflare-purgefile 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/ */
alejodaraio / cloudflare-purgefile example snippets
use CloudFlare;
try {
$cf = new CloudFlare('[email protected]', 'theKey', 'theZoneId');
$urls = array('http://mysite.com/example');
$tags = array();
$cf->purge_files($urls, $tags);
}
catch(CloudFlareException $e) {
print $e->getMessage();
}