is there any way in which i could open a file in php to read a file n convert it to its hexadecimal equivalent..
read a file n convert it to its hexadecimal equivalent
Collapse
X
-
The above is not complete it reads the actual files contents but does not convert it to hexadecimal.
EDIT:Code:$filename = "c:\\files\\somepic.gif"; $handle = fopen($filename, "rb"); $contents = [u]bin2hex[/u]( fread( $handle, filesize($filename) ) ); fclose($handle);
Oh and useto convert it back.Code:pack( "H*", $contents );
Comment
Comment