Please Help me translate this perl script into PHP
Posted: Wed Apr 26, 2006 2:35 am
Hi you guys,
Anyone knows about perl please help me translate this perl script into php, I only know PHP and i am feeling so hard to do this. This will have done my project and I'm proud to write ur name as my teacher.
Thanks in advance
Perl script to convert a file to hex
Contributed by Kenric Mckenzie. This script may be useful when sending ringtones or graphics.
Anyone knows about perl please help me translate this perl script into php, I only know PHP and i am feeling so hard to do this. This will have done my project and I'm proud to write ur name as my teacher.
Thanks in advance
Perl script to convert a file to hex
Contributed by Kenric Mckenzie. This script may be useful when sending ringtones or graphics.
Code: Select all
open(F, "image.gif") || die $!;
$s = $hx = "";
while (read(F, $s, 1) > 0) {
$hx .= sprintf("%02X", ord($s));
}
close F;
print "The hex-encoded GIF file is: $hx\n";