Skip to content

Instantly share code, notes, and snippets.

@gr4y
Created June 14, 2011 19:48
Show Gist options
  • Select an option

  • Save gr4y/1025708 to your computer and use it in GitHub Desktop.

Select an option

Save gr4y/1025708 to your computer and use it in GitHub Desktop.
Another reason why PHP sucks: i just wanted to strip the params and the first / in the uri.
private function _resolve_controller_action_array(){
$uri = current( explode('?', server::get('request_uri'), 2) );
$pos = stripos ( $uri, '/' );
$len = strlen ( $uri );
return explode( '/', trim( substr( $uri, $pos + 1, $len ) ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment