I would like to get parameter from variable that holds URL.
I got the following variable: $lastPage that holds the URI of the previous page.
I would like to get a parameter from it.
I got the following script in javascript (which I use for something else)
function getUrlVar(key)
{
var result = new RegExp(key + '=([^&]*)', 'i').exec(window.location.search);
return result && unescape(result[1]) || '';
}
I want something like that but for PHP.
Thank you very much