はコードの下に試してみてくださいがありますので
<?php
if($_POST["occupation"] == '1'){
$occupation = 'Salaried';
}
else{
$occupation = 'Self+Employed';
}
$url = 'http://www.aaa.com/ajaxv2/getCompareResults.html?interestRateType='.$_POST["interestRateType"]'.&occupation='.$_POST["occupation"].'&offeringTypeId='.$_POST["offeringID"].'&city='.$_POST["city"].'&loanAmt='.$_POST["loanAmt"].'&age='.$_POST["age"];
echo $url;
// Initiate curl
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$result=curl_exec($ch);
// Closing
curl_close($ch);
$json = json_decode($result, true);
//print_r($json);
//echo $json['resultList']['interestRateMin'];
$json_array = $json['resultList'];
print_r($json_array);
?>
前に構文エラーを持っているあなたは、この問題を引用Inproperエラー –
構文エラー、予期しないT_CONSTANT_ENCAPSED_STRING – user5397448
を投稿することができます。試してみてください。$ url = 'http://www.aaa.com/ajaxv2/getCompareResults.html?interestRateType = '。$ _ POST ["interestRateType"]。'&occupation = '。$ _ POST ["occupation"]。&offeringTypeId ='。$ _ POST ["offeringID"] [&quot; loanAmt "]。&age = '。$ _ POST [" age "]; && $ _ POST [" loanAmt "]。 – user3040610