note 39533 added to function.bin2hex

From: Date: Sun, 01 Feb 2004 14:14:55 +0000
Subject: note 39533 added to function.bin2hex
Groups: php.notes 
Request: Send a blank email to php-notes+get-64503@lists.php.net to get a copy of this message
I needed a little function that will print the binary as a string, here it comes. function bin2string($bin) { $res = ""; for($p=31; $p >= 0; $p--) { $res .= ($bin & (1 << $p)) ? "1" : "0"; } return $res; } ---- Manual Page -- http://www.php.net/manual/en/function.bin2hex.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39533 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39533&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39533&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64503) next »