Bonito Bonito - 3 months ago 9
PHP Question

Convert an array in a string with PHP

I have this array in PHP:

Array
(
[module] => booking-edit
[action] => new
[cid] => 2016-08-21
)


How can I convert it to a string like this:

module=booking-edit&action=new&cid=2016-08-21


Thanks for your help.

Answer

You can try http_build_query

$string = http_build_query($array);
Comments