jetpackman Posted October 19, 2009 Share Posted October 19, 2009 Trying to Get: Decimal: 305419896 Out of: Binary String: xV4 Link to comment https://forums.phpfreaks.com/topic/178245-convert-binary-string-to-decimal/ Share on other sites More sharing options...
simshaun Posted October 19, 2009 Share Posted October 19, 2009 Technically, (I think), what you posted is not a "binary" value. Check out bindec(). Link to comment https://forums.phpfreaks.com/topic/178245-convert-binary-string-to-decimal/#findComment-939800 Share on other sites More sharing options...
salathe Posted October 19, 2009 Share Posted October 19, 2009 $decimal = unpack('V', $binary); Link to comment https://forums.phpfreaks.com/topic/178245-convert-binary-string-to-decimal/#findComment-939802 Share on other sites More sharing options...
jetpackman Posted October 19, 2009 Author Share Posted October 19, 2009 Thanks guys. Saluthes answer worked! Coming from a C/C++ background, all these data conversions are just mind boggling. Link to comment https://forums.phpfreaks.com/topic/178245-convert-binary-string-to-decimal/#findComment-939809 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.