data2image/File2Img.php

19 lines
413 B
PHP
Raw Normal View History

2010-12-21 16:53:40 +01:00
<?php
require "val2rgb.php";
2010-12-21 16:53:40 +01:00
$file = $argv[1];
if(file_exists($file) === FALSE) die("Error: file does not exist!\n");
2010-12-21 16:53:40 +01:00
$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";
?>