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
$web_url = 'http://www.writephponline.com?name=shubham&email=singh@gmail.com'; $query = parse_url($web_url, PHP_URL_QUERY); parse_str($query, $queryArray); echo "Name: " . $queryArray['name']; // Result: shubham echo "EMail: " . $queryArray['email']; // Result:singh@gmail.com