nwk
Sep 18th 2007, 11:42 am
I just tried to convert char into hex using the following code:
<?php
$char='H';
$format="------%02x----";
$hex=sprintf($format,$char);
echo($hex);
?>
this type of conversion works in C and Perl .. but its not working in php.. I just read in PHP.net (http://in.php.net/manual/en/function.sprintf.php) about this and according to it, the code must work .. I don't understand the problem... Please let me know if you have any solution..
Thanks
Nwk
<?php
$char='H';
$format="------%02x----";
$hex=sprintf($format,$char);
echo($hex);
?>
this type of conversion works in C and Perl .. but its not working in php.. I just read in PHP.net (http://in.php.net/manual/en/function.sprintf.php) about this and according to it, the code must work .. I don't understand the problem... Please let me know if you have any solution..
Thanks
Nwk