ip address
ip-address
Common Regular Expressions
Mon, 03/24/2008 - 10:32 | by philipnorton42Here are some of the regular expressions that I frequently use.
Find a blank line
^$
Spaces
[ \t]+
You can use this to break a text string apart into words.
Date
\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}
This will match anything in the format mm/dd/yyyy, or even dd/mm/yyyy.
How To Read A Remote IP Address In PHP
Wed, 01/16/2008 - 14:44 | by philipnorton42PHP keeps certain variables to do with server and networking in an associative array called SERVER. To find out the remote address of a user you can use the array identifier REMOTE_ADDR. This is used in the following manner.
$ipaddress = $_SERVER['REMOTE_ADDR'];
This IP address can be passed into the gethostbyaddr() function to find out host name associated with the specified IP address.