Jump to content

preg_match for a variable, please help


tough_time

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.