I have a HTML form field $_POST[\"url\"] having some URL strings as the value. Example values are:
$_POST[\"url\"]
https://example.com/test/1234?email=xyz@test.com
You can use the parse_url() and parse_str() for that.
$parts = parse_url($url); parse_str($parts['query'], $query); echo $query['email'];
If you want to get the $url dynamically with PHP, take a look at this question:
$url
Get the full URL in PHP