Reputation: 2087
How is possible extract only the number after the last = symbol in a string like this:
/neuroscan/analysis/admin/listo_aoi_list.php?mastertable=listo_pages&masterkey1=11
the number could be 1,11,345,888888
etc, I would if possible get it into an int variable.
Thanks
Upvotes: 0
Views: 86
Reputation: 1398
Try
$url = $_SERVER['REQUEST_URI'];
$val = (explode("=",$url));
end($val);
It will always return you the last value after "="
Upvotes: 1
Reputation: 695
You can try this:
$url = $_SERVER['REQUEST_URI'];
$val = (explode("=",$url));
echo $val[1];
$val[1]
to getting second value after explode text after "="
Upvotes: 1