I looked at the URL helper and URI class and I noticed that both of these work off the URL in the address bar. Is there a way I can use this helper or class with my own URL string? I want to retrieve the last segment of a URL I give and I don’t want to resort to preg_match unless I need to. Is there a way to do this with codeigniter functionality?
I looked at the URL helper and URI class and I noticed that both
Share
If you have a string in the format of http://example.com/foo/bar (I presume that’s what you mean by ‘own URL string’?), you should be able to just do something like this: