Parse associative array to url in php

<?php
$params = array(
'query' => 'something',
'page' => 1,
'items' => 10
);
$url = 'http://someapi.com/search';
if (count($params) > 0) {
$url .= '?' . implode('&', array_map(function($item) {
return $item[0] . '=' . $item[1];
}, array_map(null, array_keys($params), $params)));
}
echo $url; // http://someapi.com/search?query=something&page=1&items=10
?>