【发布时间】:2017-03-29 00:14:56
【问题描述】:
好的,我确信有一个超级简单的解决方案,但我必须生成一个字符串来获取一个 json 文件。我知道我应该使用 & amp;而不是&,但由于某种原因它对我不起作用。我的问题是我在尝试创建字符串时得到 ¤:
$apistr = 'https://remitradar.com/JsonRequests.aspx?action=getOnlineQuotes&companyKey='.$companyKey.'&countryFrom='.$countryFrom.'&countryTo='.$countryTo.'¤cyFrom='.$currencyFrom.'¤cyTo='.$currencyTo.'&amount='.$amount;
吐出来了:
https://remitradar.com/JsonRequests.aspx?action=getOnlineQuotes&companyKey=23e9b66aspp6z&countryFrom=AU&countryTo=FJ¤cyFrom=AUD¤cyTo=FJD&amount=200
代替:
https://remitradar.com/JsonRequests.aspx?action=getOnlineQuotes&companyKey=23e9b66aspp6z&countryFrom=AU&countryTo=FJ&CurrencyFrom=AUD&CurrencyTo=FJD&amount=200
任何帮助都会很棒。
编辑:
这是变量的var_dump和url:
string(13) "23e9b66aspp6z"
string(2) "AU"
string(2) "FJ"
string(3) "AUD"
string(3) "FJD"
string(3) "200"
string(159) "https://remitradar.com/JsonRequests.aspx?action=getOnlineQuotes&companyKey=23e9b66aspp6z&countryFrom=AU&countryTo=FJ¤cyFrom=AUD¤cyTo=FJD&amount=200"
【问题讨论】:
标签: php