$response[0] = $msg; $response[1] = false; echo json_encode($response); exit; } $line = explode("|| ", $check); $temp_id = $line[2]; $spouse = Spouse::getById($temp_id); foreach ($spouse as $key) { Place::dropById($key->place); } Spouse::dropByPerson($temp_id); Parents::dropByPerson($temp_id); Birth::dropByPerson($temp_id); Burial::dropByPerson($temp_id); Death::dropByPerson($temp_id); Place::dropByPerson($temp_id); Person::dropByPerson($temp_id); $response[] = "Person was Deleted"; echo json_encode($response); exit; } if ($action == 'getPlace') { if (isset($_REQUEST['place'])) { } $place = $_REQUEST['place']; $set = Place::getByTown($place); echo json_encode(array_values(get_object_vars($set))); exit; exit; }