Hi All
I want to fetch id from the url.
URL:- http://localhost/projects/PortalGrocery/development/admin/qareports/index/edit/3
I have tried:-
$update_url = $_SERVER['REQUEST_URI'];
$path = parse_url($update_url, PHP_URL_PATH);
$pathComponents = explode("/", trim($path, "/"));
$ID = $pathComponents[7];
It is working fine but when i upload my project on live site, i have to change the component number everytime and in every controller as there is difference in no. of components.
So, I want to know if there is any other method to fetch to do so..?
Thanks in advance.