Function : urlParams

This function returns the query parameters of a supplied url.

  $url = 'http://site.com/users?val=foo&var=bar';

  print_r( urlParams($url) ); // ['val'=>'foo', 'var'=> 'bar']                  
                  

Note that if no argument is supplied, the current page url is assumed to be the default url.