get last element in URL(menu item) generated by hook_menu I have created a URL/menu item via hook_menu, and in the proprocess_html I'd like to get my item (last element in the URL) (/test) without using arg(0).

I can do it in PHP but I was wondering how it was possible to get this with drupal.

end(explode("/", request_uri()))


this code is actually bad, there could be URL such as ?test=ok

Cheers,
array_pop(arg());


will return the last component of the current Drupal path.