Closed
Description
AS-IS
Currently, you can only obtain MAGIC information in the file specified in the first argument.
<?php
echo filebin('sample string');
?>
Result:
PHP Warning: sample string file not found. in /root/work/github/php/mod_filebin/sample.php on line 63
Warning: sample string file not found. in /root/work/github/php/mod_filebin/sample.php on line 1
TO-BE
If the first 5Byte of the 1st argument value is DATA: prefix, use the magic_buffer api instead of the magic_file api.
<?php
$buffer = file_get_contents('/some/path/image.png');
echo filebin('DATA:' . $buffer);
?>