note 101833 added to function.dechex

From: Date: Thu, 13 Jan 2011 12:50:59 +0000
Subject: note 101833 added to function.dechex
Groups: php.notes 
Request: Send a blank email to php-notes+get-175701@lists.php.net to get a copy of this message
After numerous hours of trying to actually receive a hexadecimal digit from dechex, I decided to give it a go myself. I kept trying to do bitwise comparisons on the result however I was comparing strings, function dectohex($dec){ $code='return 0x'.dechex($dec).';'; return eval($code); } This actually returns a hexadecimal value, not a string representation. Hopefully this saves someone else a couple of hours. ---- Server IP: 69.147.83.197 Probable Submitter: 203.45.123.52 ---- Manual Page -- http://www.php.net/manual/en/function.dechex.php Edit -- https://master.php.net/note/edit/101833 Del: integrated -- https://master.php.net/note/delete/101833/integrated Del: useless -- https://master.php.net/note/delete/101833/useless Del: bad code -- https://master.php.net/note/delete/101833/bad+code Del: spam -- https://master.php.net/note/delete/101833/spam Del: non-english -- https://master.php.net/note/delete/101833/non-english Del: in docs -- https://master.php.net/note/delete/101833/in+docs Del: other reasons-- https://master.php.net/note/delete/101833 Reject -- https://master.php.net/note/reject/101833 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175701) next »