Get rid of a redundant directory level.

This commit is contained in:
2016-08-20 22:31:29 +02:00
parent abb6ae9ba0
commit b2256b2454
556 changed files with 0 additions and 0 deletions

26
projects/nalgh/example.php Executable file
View File

@@ -0,0 +1,26 @@
<?php
include('nalgh.php');
header('content-type: text/plain; charset=utf-8');
//$txt = 'The paper was nervous. After the day of destiny it had not dared to leave the printer. The printer seemed unhappy with the situation and had subsequently tried to cheer up the piece of paper. But death had taken its toll. The ink was no more.';
$fn = 'writeclearly-preface';
$f = fopen($fn, 'r');
$txt = fread($f, filesize($fn));
fclose($f);
$len = strlen($txt);
$ntxt = nalgh_compress($txt);
$nlen = strlen($ntxt);
$dtxt = nalgh_decompress($ntxt);
$dlen = strlen($dtxt);
echo $txt;
echo "\nOriginal text: $len\n\n";
echo $ntxt;
echo "\nCompressed text: $nlen\n\n";
echo $dtxt;
echo "\nDecompressed text: $dlen\n\n";
echo 'Compressed takes up '. $nlen / $len * 100 . '% of original.';
?>