php - How to convert array to url parameter? -
this question has answer here:
- php function build query string array 6 answers
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
Post a Comment