0) { while ($mar = mysql_fetch_array($result)) { if($mar['type'] == 'bar') {$cattype = "Бар";} if($mar['type'] == 'restaurant') {$cattype = "Ресторан";} if($mar['type'] == 'cafe') {$cattype = "Кафе";} $descriptions = str_replace("\n", "
", $mar['descriptions']); $json = $json.'{"name" : "'.$mar['name'].'", "descriptions" : "'.$descriptions.'", "type":"'.$cattype.'", "lat" : "'.$mar['cx'].'", "lng" : "'.$mar['cy'].'"},'; } } $json = substr($json , 0,-1); echo $json , ']}'; } ?>