Possible Duplicate:
Reading a File into a Byte Array (PHP)
I need this below (C#) method in php, any help?
private byte[] FileByteArray(string filePath) {
StreamReader sr = new StreamReader(filePath);
Stream st = sr.BaseStream;
BinaryReader br = new BinaryReader(st);
byte[] arrBytes = br.ReadBytes((st.Length + 1));
br.Close();
st.Close();
return arrBytes;
}
$content = file_get_contents($filePath);
// now we can access $content as an byte array
for ($i = 0, $c = strlen($content); $i < $c; $i++)
echo($content[$i]);