3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'http://mysite.com/hello/world?look_at=me'; $query = parse_str(parse_url($url, PHP_URL_QUERY)); ?> <a href="?<?= http_build_query(array_merge($query, ['category' => 'val'])) ?>">Категория каталога</a> <a href="?<?= http_build_query(array_merge($query, ['sort' => 'price'])) ?>">Сортировать по цене</a>