PHP‎ > ‎

check ip con wildcard

pubblicato 3 giu 2013, 02:42 da Roberto Gambuzzi
echo preg_match("/".str_replace('\*','\d+',preg_quote('192.168.153.*'))."/", "192.168.153.12");
echo "<br >";
echo preg_match("/".str_replace('\*','\d+',preg_quote('192.168.153.*'))."/", "192.168.152.12");
echo "<br >";
echo preg_match("/^".str_replace('\*','\d+',preg_quote('192.168.153.12'))."$/", "192.168.153.12");
echo "<br >";


Comments