我怎样才能打开allow_url_fopen的.htaccess还是一个PHP文件?
我有以下代码(如下),并使用iGoogle版本.
$url = 'http://www.google.com/ig/calculator?hl=en&q=' . $amount . $from_Currency . '=?' . $to_Currency;
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$rawdata = curl_exec($ch);
curl_close($ch);
$data = explode('"', $rawdata);
$data = explode(' ', $data[3]);
$var = $data[0];
Run Code Online (Sandbox Code Playgroud)
但看了他们正在使用不同的URL:
'http://www.google.com/finance/converter?hl=en&a=' . $amount . '&from=' . $from_Currency . '&to=USD';
Run Code Online (Sandbox Code Playgroud)
但只是更改网址并不会返回我习惯的所需结果.
现在我得到的只是
http://www.w3.org/TR/html4/strict.dtd
Run Code Online (Sandbox Code Playgroud)
SO有任何人都在研究这个最新的货币转换器URL或有任何想法.或使用PHP替换