reading binary code of a file...in PHP
- by Val
How can I read the binary code(to get the 1s and 0s) of a file.
$filename = "something.mp3";
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
fclose($handle);
I tried this but it shows some strange characters... i presume that this is the formated binary...? I was hoping to get the 1's and 0's instead....
also i am not looking only .mp3 files it could be anything .e.g: .txt , .doc , .mp4, .php
.jpg,.png etc....
Thanks