I have this code and it works perfectly for a single result. I now want to return an array or results and potentially an array of arrays (a full dataset).
Can someone help me return these results?
<?php
require_once "lib/nusoap.php";
class food {
public function getFood($type) {
switch ($type) {
case 'starter':
return 'Soup';
break;
case 'Main':
return 'Curry';
break;
case 'Desert':
return 'Ice Cream';
break;
default:
break;
}
}
}
class User {
public function getName($type) {
switch ($type) {
case '1':
return 'John';
break;
case '2':
return 'Michael';
break;
case '3':
return 'Derek';
break;
default:
break;
}
}
}
$server = new soap_server();
$server->configureWSDL("foodservice", "http://localhost/nuSOAP");
$server->register("food.getFood",
array("type" => "xsd:string"),
array("return" => "xsd:string"),
"http://localhost/nuSOAP",
"http://localhost/nuSOAP#getFood",
"rpc",
"encoded",
"Get food by type");
$server->register("user.getName",
array("type" => "xsd:string"),
array("return" => "xsd:string"),
"http://localhost/nuSOAP",
"http://localhost/nuSOAP#getName",
"rpc",
"encoded",
"Get food by type");
@$server->service($HTTP_RAW_POST_DATA);