Paul Gregg

Jack of all Tech.

Archive for April, 2009

PHP algorithms: Determining if an IP is within a specific range.

00000I spend a lot of time lurking in the #PHP channel (efnet and freenode, please – no flamewars) and this topic is a commonly asked one that usually gets a simplified answer in the form of using strpos(), or at best an ip2long() in a greater than and less than answer. Unfortunately although people usually […]

Read the rest of this entry »

Caught red-handed.

00000Only two hours after he was supposed to be asleep… Only light source was the Nintendo DS.

Read the rest of this entry »

tail -# file, in PHP

00000I read Kevin’s Read Line from File article today and thought I would add some sample code I wrote a while back to address a similar task in PHP – How to perform the equivalent of “tail -# filename” in PHP. A typical task in some applications such as a shoutbox or a simple log […]

Read the rest of this entry »