phpCopy<?php
$url = "https://testurl.com/test/1234?email=abc@test.com&name=sarah";
$components = parse_url($url);
parse_str($components['query'], $results);
print_r($results);
?>
phpCopy<?php
echo $_GET['email'] . $_GET['name']
?>
<?php
if (isset($_GET['link'])) {
echo $_GET['link'];
} else {
// Fallback behaviour goes here
}
phpCopy<?php
$url = "https://testurl.com/test/1234?email=abc@test.com&name=sarah";
$components = parse_url($url, PHP_URL_QUERY);
//$component parameter is PHP_URL_QUERY
parse_str($components, $results);
print_r($results);
?>
phpCopy<?php
$url = "https://testurl.com/test/1234?email=abc@test.com&name=sarah";
$components = parse_url($url);
parse_str($components['query'], $results);
echo($results['email']);
?>
<form action="/" method="get">
<input type="text" name="search" placeholder="Search...">
<input type="submit">
</form>
<?php
echo $_GET["search"]
?>