2009年12月16日
摘要: 原文:http://www.ebrueggeman.com/blog/integers-and-floating-numbers/ Background PHP is not a strictly typed language, and many programmers often overloo... 阅读全文
posted @ 2009-12-16 21:00 菜根talk 阅读(217) 评论(0) 推荐(0) 编辑
摘要: When handling very large numbers in PHP, you'll notice they get cut off at hexadecimal 7FFFF FFFF. Sometimes, you don't need to use these numbers in an actual calculation in PHP (i.e. just editing and... 阅读全文
posted @ 2009-12-16 20:58 菜根talk 阅读(114) 评论(0) 推荐(0) 编辑
摘要: A note about converting IP addresses for storage in database. For MySQL, this is unnecessary as it has built in support via the INET functions. Also, ... 阅读全文
posted @ 2009-12-16 20:55 菜根talk 阅读(589) 评论(0) 推荐(0) 编辑
摘要: /*Here are some tricks to convert from a "dotted" IP address to a LONG int, and backwards. This is very useful because accessing an IP addy in a datab... 阅读全文
posted @ 2009-12-16 20:52 菜根talk 阅读(348) 评论(0) 推荐(0) 编辑
摘要: /************************** * int_oct($ip) * Convert INTeger rep of IP to octal (dotted quad) */ function int_oct($ip) { /* Set var... 阅读全文
posted @ 2009-12-16 20:39 菜根talk 阅读(201) 评论(0) 推荐(0) 编辑
摘要: function parse_unsigned_int($string) { $x = (float)$string; if ($x > (float)2147483647) $x -= (float)"4294967296"; ... 阅读全文
posted @ 2009-12-16 20:35 菜根talk 阅读(215) 评论(0) 推荐(0) 编辑