0

I want this:

datasetid=GHCND&locationid=ZIP:28801&startdate=2010-05-01&enddate=2010-05-01

I have this:

$data=['datasetid'=>'GHCND','locationid'=>'ZIP:28801','startdate'=>'2010-05-01','enddate'=>'2010-05-01'];

I tried this:

exit(http_build_query($data));

I got this:

datasetid=GHCND&locationid=ZIP%3A28801&startdate=2010-05-01&enddate=2010-05-01

How can I prevent ZIP:28801 from being escaped as ZIP%3A28801?

user1032531
  • 24,767
  • 68
  • 217
  • 387

1 Answers1

1

You need to urldecode the string like this:

urldecode(http_build_query($data));

Luke Bailey
  • 168
  • 2
  • 10