3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(parse_url('https://example.com?foo&bar')); $_GET = ['een', 'twee']; $newUrl = "http://my-new-website.com/"; $currentPage = $_SERVER['PHP_SELF']; //building the querystrging (if some GET variables where set): $queryString = "?"; $firstRun = true; foreach($_GET as $key => $value) { if(!$firstRun) { $queryString .= "&"; } $queryString .= $key."=".urlencode($value); } var_dump($queryString);

preferences:
67.04 ms | 402 KiB | 5 Q