Im trying to use a wild card for my ip banning script
while ($row3 = mysql_fetch_array($sql_result3)){
$hostip = $row3["Bip"];
$wildcard = "%";
$toastit = "192.168.0." . $wildcard;
if ($hostip == $toastit) {
echo "<font color=red>$hostip</font><br>";
} else {
echo "$hostip<br>";
}
}
the above code is what I want to do... it gets a IP from a database then it looks at the ip and echos out all the ips from the database high lighting all ips that start with 192.168.0.
after the .0. can be a number from 1-254, I need a wild card or somthing that will allow it to select any ip in that range..
I was thinking about using a array but I dont now how start one with out specifying 254 numbers.