tough_time Posted September 16, 2009 Share Posted September 16, 2009 Hi Guys First time post. I am struggling with an IF statement, the check should check the host variable which should accept IP address 1.2.3.4 format and also alpha numeric format as well i.e SERVER1, if (!preg_match("^[a-zA-Z-/\'/]^", $host) || preg_match("/^([a-zA-Z0-9-]+[\.])+([a-zA-Z0-9]+)$/", $host)){ Thanks Link to comment https://forums.phpfreaks.com/topic/174496-preg_match-for-a-variable-please-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.