...

View Full Version : Syntax Help



tzzoug
07-07-2007, 11:44 PM
I am trying to write a function that would validate if an input is an ip address
so i want to check for example if the format is
[1-255].[1-255].[1-255].[1-255]:[1-65535]
ive spent countless hours trying to mess around with lines like
/^(-){0,1}([0-9]+)(,[0-9][0-9][0-9])*([.][0-9]){0,1}([0-9]*)$/
but, i don't fully understand it (if you know a tutorial maybe, that would be great)
Thanks

fl00d
07-08-2007, 02:07 AM
why don't you just use

$_SERVER['REMOTE_ADDR'];
?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum