In codeigniter I am trying to make an application which will accept a URI of an arbitrary length, such as:
http://example.com/files/some/arbitrary/length/uri
In开发者_如何学Python the routes.php file i have the following rule to get the first URI segment:
$route['files/(:any)'] = "files/uri/$1";
How would I be able to get the rest of the address as a variable not knowing how many URI segments there might be in it?
Thanks, Diarmuid
Figured it out.
Keeping the same route.php rule as before I then use codeigniters URL_Helper function uri_string() to get the URI segments. This can then be broken up into an array using the explode function.
精彩评论