note 113057 added to function.hex2bin
| From: | jannik | Date: | Fri, 23 Aug 2013 12:00:58 +0000 |
| Subject: | note 113057 added to function.hex2bin | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196059@lists.php.net to get a copy of this message | ||
I modified the function by Johnson a bit so it can be used as a drop-in-replacement. You don't
need to worry about upgrading php because when it is upgraded, it will use the build in function.
<?php
if ( !function_exists( 'hex2bin' ) ) {
function hex2bin( $str ) {
$sbin = "";
$len = strlen( $str );
for ( $i = 0; $i < $len; $i += 2 ) {
$sbin .= pack( "H*", substr( $str, $i, 2 ) );
}
return $sbin;
}
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 212.29.41.170
----
Manual Page -- http://php.net/manual/en/function.hex2bin.php
Edit -- https://master.php.net/note/edit/113057
Del: integrated -- https://master.php.net/note/delete/113057/integrated
Del: useless -- https://master.php.net/note/delete/113057/useless
Del: bad code -- https://master.php.net/note/delete/113057/bad+code
Del: spam -- https://master.php.net/note/delete/113057/spam
Del: non-english -- https://master.php.net/note/delete/113057/non-english
Del: in docs -- https://master.php.net/note/delete/113057/in+docs
Del: other reasons-- https://master.php.net/note/delete/113057
Reject -- https://master.php.net/note/reject/113057
Search -- https://master.php.net/manage/user-notes.php