if($longitude >= $teamrow['longitude']-2 AND $longitude <= $teamrow['longitude']+2 AND $latitude >= $teamrow['latitude']-2 AND $latitude <= $teamrow['latitude']+2){ ...
if($lng >= $teamrow['lng']-2 AND $lng <= $teamrow['lng']+2 AND $lat >= $teamrow['lat']-2 AND $lat <= $teamrow['lat']+2){ ...
oli004 a dit:if($longitude >= $teamrow['longitude']-2 AND $longitude <= $teamrow['longitude']+2 AND $latitude >= $teamrow['latitude']-2 AND $latitude <= $teamrow['latitude']+2){ ...
Code:if($lng >= $teamrow['lng']-2 AND $lng <= $teamrow['lng']+2 AND $lat >= $teamrow['lat']-2 AND $lat <= $teamrow['lat']+2){ ...
C'est déja plus court non ? :wink:
if($a >= $b['a']-2 && $a <= $b['a']+2 && $c>= $b['c']-2 && $c <= $b['c']+2){ ...
sff a dit:Ca revient au meme. Tu diminue juste le nom des variables.
$distance_lng = abs($longitude - $teamrow['longitude']);
$distance_lat = abs($latitude - $teamrow['latitude']);
if($distance_lng <= 2 AND $distance_lat <= 2){
$distance = sqrt(pow(($lat1 - $lat2), 2) + pow(($lng1 - $lng2), 2));
if ($distance < ...) {
if(abs($longitude - $teamrow['longitude']) <= 2 AND abs($latitude - $teamrow['latitude']) <= 2){ ...