Hello all, ive been coding with php for a few years. and i have run into a problem that i cant figure out, i have the following code and were all the imageline code is, i want to make it so that it loops through and all the array's from $signal[0] to $signal[n] where n is the last array. any help would be great thanks
-Phil
<?PHP
#
Header("Content-type: image/png");
function imagegrid($image, $w, $h, $s, $color)
{
for($iw=0; $iw<$w/$s; $iw++){imageline($image, $iw*$s, 1, $iw*$s, $w, $color);}
for($ih=0; $ih<$h/$s; $ih++){imageline($image, 1, $ih*$s, $w, $ih*$s, $color);}
}
$Width=640;
$Height=480;
$img = ImageCreateTrueColor($Width, $Height);
$bg = imagecolorallocate($img, 255, 255, 255);
imagefill($img, 0, 0, $bg);
$grid = imagecolorallocate($img, 0, 0, 0);
imagesetstyle($img, array($bg, $grid));
imagegrid($img, $Width, $Height,19.99, $grid);
$string = "Seminara|00:14:6C:FC:25:9A|Netgear|34%|Open|WEP|802.11g|11|N 41.6394200|W 70.2836550|1 2 5.5 11|6 9 12 18 24 36 48 54|09-29-2007 12:56:13 406|09-29-2007 12:56:13 406|Infrastructure|Unknown| 34-34-34-34-34";
$wifissid = explode("|", $string, 17);
$sig= $wifissid[16];
$signal = explode("-", $sig);
$color = imagecolorallocate($img, 255, 0, 0);
imageline($img, 20 ,460, 20, 460-($signal[0]*4), $color);
imageline($img, 21 ,460, 21, 460-($signal[0]*4), $color);
imageline($img, 25 ,460, 25, 460-($signal[1]*4), $color);
imageline($img, 26 ,460, 26, 460-($signal[1]*4), $color);
imageline($img, 30 ,460, 30, 460-($signal[2]*4), $color);
imageline($img, 31 ,460, 31, 460-($signal[2]*4), $color);
imageline($img, 35 ,460, 35, 460-($signal[3]*4), $color);
imageline($img, 36 ,460, 36, 460-($signal[3]*4), $color);
imageline($img, 40 ,460, 40, 460-($signal[4]*4), $color);
imageline($img, 41 ,460, 41, 460-($signal[4]*4), $color);
ImagePNG($img);
ImageDestroy($img);
?>