0
我想這一點:創建一個URL(HTTP查詢)與PHP沒有逃脫特殊的字符
datasetid=GHCND&locationid=ZIP:28801&startdate=2010-05-01&enddate=2010-05-01
我有這樣的:
$data=['datasetid'=>'GHCND','locationid'=>'ZIP:28801','startdate'=>'2010-05-01','enddate'=>'2010-05-01'];
我嘗試這樣做:
exit(http_build_query($data));
我得到這個:
datasetid=GHCND&locationid=ZIP%3A28801&startdate=2010-05-01&enddate=2010-05-01
如何防止ZIP:28801
被盜號爲ZIP%3A28801
?
http://stackoverflow.com/questions/6132721/http-build-query-without-url-encoding – labue