This is a custom solution to easily add collapsible code blocks to WordPress posts. Tested with Classic Editor and Advanced Editor Tools plugins installed. Continue reading
Tag Archives: php
Force Files to Download rather than Open in browser
There are certain circumstances where it’s desirable to force files hosted on an Apache web server to download rather than rendering in the browser. This can be accomplished using the following .htaccess file… Continue reading
Simple PHP script to Tar a folder
Leave a reply
Here it is…
<?php
$path = explode("/",realpath('./'));
$filename = date("Y-m-d_His") . "_" . array_pop($path);
echo "<pre>Compressing ./* to ../${filename}.tgz</pre>";
$output = shell_exec('tar -cvz --exclude "./dotar.php" -f ../' . $filename . '.tgz ./*');
echo "<pre>$output</pre>";
echo "<pre>Done.</pre>";
?>