note 83458 added to function.hexdec
| From: | this1is4me at hotmail dot com | Date: | Tue, 27 May 2008 09:46:23 +0000 |
| Subject: | note 83458 added to function.hexdec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139841@lists.php.net to get a copy of this message | ||
In reply to Amit Yadav's post (hex to binary conversion):
function binfromdec($num)
{
$primary = "bit";
for ($i=1; $i<=16; $i++)
${$primary.$i} = 0;
if ($num & 32768) $bit16 = 1;
if ($num & 16384) $bit15 = 1;
if ($num & 8192) $bit14 = 1;
if ($num & 4096) $bit13 = 1;
if ($num & 2048) $bit12 = 1;
if ($num & 1024) $bit11 = 1;
if ($num & 512) $bit10 = 1;
if ($num & 256) $bit9 = 1;
if ($num & 128) $bit8 = 1;
if ($num & 64) $bit7 = 1;
if ($num & 32) $bit6 = 1;
if ($num & 16) $bit5 = 1;
if ($num & 8) $bit4 = 1;
if ($num & 4) $bit3 = 1;
if ($num & 2) $bit2 = 1;
if ($num & 1) $bit1 = 1;
return ($bit16. $bit15. $bit14. $bit13. $bit12. $bit11. $bit10. $bit9. $bit8. $bit7. $bit6. $bit5.
$bit4. $bit3. $bit2. $bit1);
}
----
Server IP: 83.137.20.135
Probable Submitter: 80.127.96.38
----
Manual Page -- http://www.php.net/manual/en/function.hexdec.php
Edit -- https://master.php.net/note/edit/83458
Del: integrated -- https://master.php.net/note/delete/83458/integrated
Del: useless -- https://master.php.net/note/delete/83458/useless
Del: bad code -- https://master.php.net/note/delete/83458/bad+code
Del: spam -- https://master.php.net/note/delete/83458/spam
Del: non-english -- https://master.php.net/note/delete/83458/non-english
Del: in docs -- https://master.php.net/note/delete/83458/in+docs
Del: other reasons-- https://master.php.net/note/delete/83458
Reject -- https://master.php.net/note/reject/83458
Search -- https://master.php.net/manage/user-notes.php