-1
if(isset($_POST["submit"]))
{
$f_name = $_FILES["filetoupload"]["name"];
$f_tmp = $_FILES["filetoupload"]["tmp_name"];
$store = "uploads/".$f_name;
if(move_uploaded_file($f_tmp,$store))
{
echo "file uploaded successfully";``
echo"<br>";
}
$f_open = fopen($store,"r");
$line = fgets($f_open);
$url = "http://maps.googleapis.com/maps/api/geocode/json?address=";
$furl ="$url"."$line";
echo "$furl";
$ch = curl_init();
$fp = fopen("example4.txt","w");
curl_setopt($ch, CURLOPT_URL, $furl);
curl_setopt($ch, CURLOPT_PROXY, '10.10.80.11:3128');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
JSON DECOD無法提取文本文件JSON解碼不獲取URL
$jsondata = file_get_contents('example4.txt',true);
$data=json_decode($jsondata,true);
echo "$data";
(line 50) $address=$data->results[0]->address_components;
echo "$address";
}
這裏JSON解碼似乎沒有工作,因爲它不是借陣列 ,也沒有URL ISN 「T通過curl.and errorr passsing是注意:試圖讓非對象的屬性在C:\ XAMPP \ htdocs中\ phpprog \ upload_file_add.php上線50 ...任何幫助將是 欣賞
那麼什麼是文件的內容'範例4 .txt'? – 2015-02-24 10:57:28