Hi!
Do a chunk_split() on the ip, explode, then check wether the char is a dot or not.
<?PHP
function z_imgcode($num) {
$img_code = "<img src=\"num_gifs/$num.gif\" width=\"12\" height=\"12\" border=\"0\">";
return $img_code;
}
$splitip = chunk_split($_SERVER['REMOTE_ADDR'], 1, ',');
$iparr = explode(",", $splitip);
for($i=0;$i<sizeof($iparr);$i++) {
if($iparr[$i] != "") {
if($iparr[$i] != ".") {
$ipstring .= z_imgcode($iparr[$i]);
} else {
$ipstring .= "<img src=\"num_gifs/dot.gif\" width=\"12\" height=\"12\" border=\"0\">";
}
}
}
echo $ipstring;
echo "<br>";
?>
I've submitted a zip with gifs to test for your self 😉
knutm