私は元同僚からいくつかのコードを継承しましたが、最近それが製品化されたため、いくつかの問題が発生しています。私は php 開発者ではないので、これが漠然としているように見える場合は申し訳ありませんが、私に落ちました (聞かないでください!)。
関数を呼び出してgetLoan()
、既存のアプリケーションからアプリケーション フォームに事前入力します。これは配列を返すはずですが、stdClass エラーが発生しています。
$result = getLoan(); //this is the line that is erroring
if (isset($result->GetResult->Debtor->Addresses->Address[0])) $current_address = clone $result->GetResult->Debtor->Addresses->Address[0];
else $current_address = clone $result->GetResult->Debtor->Addresses->Address;
if ($result === false)
{
echo("No LID given");
die;
}
$attr = 'selected';
そして機能:
function getLoan() {
//globals
/*
global $client;
global $test;
global $result;
*/
global $thisurl;
if (isset($_GET['LID']))
$pLoanID = $_GET['LID'];
else
return false;
$test = array(
"pLoanID" => $pLoanID,
);
//print_r($Address); //print address object as a test
//send to gateway starts**********
$url = "https://www.blahblah.asmx?WSDL";
$client = new SoapClient($url, array("trace" => 1, "exception" => 0));
try {
$result = $client->Get($test);
}
catch(Exception $e) {
//header("Location: http://" . $_SERVER['REMOTE_ADDR'] . "/application-form-new");
print_r($e);
exit;
}
$thisurl = "continue-app?LID=" . $pLoanID;
if (isset($result)) return $result;
else return false;
}
関数からの戻り値を配列として $result に割り当てるにはどうすればよいですか?
どうもありがとう