I want to fetch id from the url.
I have tried:-
$update_url = $_SERVER['REQUEST_URI'];
$path = parse_url($update_url, PHP_URL_PATH);
$pathComponents = explode("/", trim($path, "/"));
$ID = $pathComponents;
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.