tags:

views:

33

answers:

2

I have an array of the form array( 'paramName1'=>'param1', 'paramName2'=>'param2', ...) and want to turn it into a request string of the form paramName1=param1&paramName2=param2&...

It's easy enough to write a function to do this myself, but I was wondering if php already had a function to do this built in?

+1  A: 

http_build_query

Sjoerd
That's the one, thanks.
death_au
+1  A: 

Yes, and that is http_build_query(). It's only available in PHP 5 though so if you're still using PHP 4 you'll have to roll your own function.

BoltClock
Exactly what I was looking for. I knew there was something but couldn't find it.Thanks.
death_au