@ :
Another question ...
If I want to compare two string and replace one or more Ip address with "xxx.xxx.xxx.xxx" if match , how I've to do ?
<?
$iptofind="56.333.22.666
dsdsdsdsdsdsds dsd dsd dsds
dsd sd 199.33.222.11 dsdsdsd jtyjtjjtj
jtjtjjjtjt tjjtjtjtjt";
$string = "asdasdfasdgfasasdfasdfa199.33.222.11s
dfsadfsadfkjaslkglaknsdflkasndflkasdnflaksndflaksn
dfladlnfakdsnflaksdf
asdkjf235.25.14.58 anskdfjbkasjdbfkasjbdfkjabsdf56.333.22.666sadAJDSHasjdkjKSDJKASD;
sdfaoisdhfoiahsdofihasdofihasodihoihfdsoifhaosidfa
ksjdkfjbsadkfjabodfas
fasodfhoiashdofihasodfihaosfgaldfknglaksdofihoisah
fdlaskfdlaksdfa44.22.333.44";
preg_match_all("/[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}/", $string,$matches);
preg_match_all("/[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}/", $iptofind,$matches2);
for ($i=0; $i< count($matches[0]); $i++) {
for ($i2=0; $i2< count($matches2[0]); $i2++) {
if ($matches[$i]=$matches2[$i2]){
$findip=str_replace($matches[$i],"xxx.xxx.xxx.xxx",$string);
}
}
}
echo $findip ;
?>
..as I have done it doesn't work..๐