无法打印json输出

I saved this file on my web server and authentication.php is there, but I was unable to display json output data in the web browser using this file. When I load it in the web browser there was no output or error... please help me.

authentication.php is a xml webservice to the server and this file gets data from that file, now the problem is, I'm trying to convert the incoming data into json and send them to google sheets using google appscript, the app script should catch the in json format


<?php 
// Boutique_Hotels_web_srv
require_once('authentication.php');

//print_r($key);
$result = $client->UseService(array('Key' => $key, 'ServiceName' => 'Boutique_Hotels_web_srv'))->UseServiceResult;
//print_r($result);

$data = array();
$data = $result->string;
$wtst_id = 1;

if(count($data) > 0){
$db->query("DELETE FROM " . DB_PREFIX . "where_to_stay WHERE wtst_id = '" . (int)$wtst_id . "' "); 
}

foreach($data as $data=>$hotel){
$hotel_data = explode('|', $hotel);

$tags = '';
if($hotel_data[18] == 'True'){
$tags .= ', Night Life';
}
if($hotel_data[19] == 'True'){
$tags .= ', Ballooning';
}
if($hotel_data[20] == 'True'){
$tags .= ', Diving, Snorking';
}
if($hotel_data[21] == 'True'){
$tags .= ', Golf';
} 
if($hotel_data[22] == 'True'){
$tags .= ', Surfing';
}
if($hotel_data[23] == 'True'){
$tags .= ', Fishing';
}
if($hotel_data[24] == 'True'){
$tags .= ', Caving';
}
if($hotel_data[25] == 'True'){
$tags .= ', Water Skiing';
}
if($hotel_data[26] == 'True'){
$tags .= ', Rock Climbing';
}
if($hotel_data[27] == 'True'){
$tags .= ', kayaking, canoeing';
}
if($hotel_data[28] == 'True'){
$tags .= ', wildlife safari';
}
if($hotel_data[29] == 'True'){
$tags .= ', agro tourism';
}
if($hotel_data[30] == 'True'){
$tags .= ', whale and dolphin watching';
}
if($hotel_data[31] == 'True'){
$tags .= ', White water rafting';
}
if($hotel_data[32] == 'True'){
$tags .= ', Shopping';
}

return $hotel;

$myObj->hotel__data0 =$hotel_data[0];
$myObj->hotel__data10 =$hotel_data[10];
$myObj->hotel__data32 =$hotel_data[32];

$myJSON = json_encode($myObj);

echo $myJSON;

}

?>

ok I resolved , with a fb group Vasile Ţucă helped me

<?php 
// Boutique_Hotels_web_srv
require_once('authentication.php');

//print_r($key);
$result = $client->UseService(array('Key' => $key, 'ServiceName' => 'Boutique_Hotels_web_srv'))->UseServiceResult;
//print_r($result);

$data = array();
$data = $result->string;
$wtst_id = 1;

if(count($data) > 0){
$db->query("DELETE FROM " . DB_PREFIX . "where_to_stay WHERE wtst_id = '" . (int)$wtst_id . "' "); 
}

foreach($data as $data=>$hotel){
$hotel_data = explode('|', $hotel);

$tags = '';
if($hotel_data[18] == 'True'){
$tags .= ', Night Life';
}
if($hotel_data[19] == 'True'){
$tags .= ', Ballooning';
}
if($hotel_data[20] == 'True'){
$tags .= ', Diving, Snorking';
}
if($hotel_data[21] == 'True'){
$tags .= ', Golf';
} 
if($hotel_data[22] == 'True'){
$tags .= ', Surfing';
}
if($hotel_data[23] == 'True'){
$tags .= ', Fishing';
}
if($hotel_data[24] == 'True'){
$tags .= ', Caving';
}
if($hotel_data[25] == 'True'){
$tags .= ', Water Skiing';
}
if($hotel_data[26] == 'True'){
$tags .= ', Rock Climbing';
}
if($hotel_data[27] == 'True'){
$tags .= ', kayaking, canoeing';
}
if($hotel_data[28] == 'True'){
$tags .= ', wildlife safari';
}
if($hotel_data[29] == 'True'){
$tags .= ', agro tourism';
}
if($hotel_data[30] == 'True'){
$tags .= ', whale and dolphin watching';
}
if($hotel_data[31] == 'True'){
$tags .= ', White water rafting';
}
if($hotel_data[32] == 'True'){
$tags .= ', Shopping';
}

$myObj["hotel_data0"] = $hotel_data[0];
$myObj["hotel_data10"] = $hotel_data[10];
$myObj["hotel_data32"] = $hotel_data[32];

$myJSON = $myObj;

var_dump($myJSON);


}

?>              

this is the correct code