php - How to convert array to url parameter? -


this question has answer here:

this array:

$url_parameter = array ( 'country' => 'usa', 'city' => 'wdc', 'from' => 'japan' ); 

i want covert output is:

country=usa&city=wdc&from=japan 

is there easy code task?

$url_parameter = array ( 'country' => 'usa', 'city' => 'wdc', 'from' => 'japan' );  echo http_build_query($url_parameter) . "\n"; echo http_build_query($url_parameter, '', '&'); 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -