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?

1

1 Answer 1

1

You need to urldecode the string like this:

urldecode(http_build_query($data));

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.