function get_bounds_projects() { $bounds = array(); $bounds['minLng'] = empty($_POST['minLng']) ? 0 : $_POST['minLng']; $bounds['minLat'] = empty($_POST['minLat']) ? 0 : $_POST['minLat']; $bounds['maxLng'] = empty($_POST['maxLng']) ? 0 : $_POST['maxLng']; $bounds['maxLat'] = empty($_POST['maxLat']) ? 0 : $_POST['maxLat']; $_project = new Project(); $projects = $_project->findByBounds(null, $bounds['minLng'], $bounds['minLat'], $bounds['maxLng'], $bounds['maxLat']); header("Content-type: application/json; charset=utf-8"); echo json_encode($projects); }