Check out example codes for "parse url php". It will help you in understanding the concepts better.

Code Example 1

var_dump(parse_url($url)); 
var_dump(parse_url($url, PHP_URL_SCHEME)); 
var_dump(parse_url($url, PHP_URL_QUERY));

Code Example 2

//https://www.google.com/search?key=1234
	$url = $_SERVER['REQUEST_URI']; 
    $url_components = parse_url($url); 
    parse_str($url_components['query'], $params); 
    $key = $params['key']; 

// key=1234

Learn ReactJs, React Native from akashmittal.com