data2image/File2Img.php

19 lines
413 B
PHP

<?php
require "val2rgb.php";
$file = $argv[1];
if(file_exists($file) === FALSE) die("Error: file does not exist!\n");
$data = file_get_contents($file);
$size = strlen($data);
$foobar = array();
for($i = 0; $i < $size; $i++) {
$char = $data[$i];
$foobar[ord($char)]++;
}
rsort($foobar);
print_r($foobar);
echo "\n\n";
echo "Strlen: " . $size . "\n";
echo "filesize: " . filesize($file) . "\n";
?>