Forum Moderators: coopster
$a = array(12, 34, 7.68966, -34.876, -65.8, -54.214, 87, 2);
preg_match_all('/(-?\d+\.?\d*)@(-?\d+\.?\d*)/', implode('@', $a), $coords);
//$coords[1] will be array containing all 'x' coordinates
//$coords[2] will be array containing all 'y' coordinates
$xmin = min($coords[1]);
$xmax = max($coords[1]);
$ymin = min($coords[2]);
$ymax = max($coords[2]);
echo "xmin = $xmin<br>xmax = $xmax<br>ymin = $ymin<br>ymax = $ymax";