Is there a php function to turn an associative array into a bunch of query parameters?

I have a form array array( 'paramName1'=>'param1', 'paramName2'=>'param2', ...)and want to turn it into a form request stringparamName1=param1¶mName2=param2&...

It is hard to write a function to do it myself, but I was wondering if php has a function to make it inline?

+3
source share
2 answers

Yes, and that http_build_query(). It is only available in PHP 5, although if you are still using PHP 4, you will have to flip your own function.

+2
source
+1
source

Source: https://habr.com/ru/post/1752213/


All Articles