Jump to content

bootstrapping, how to parse request_uri


mikeken

Recommended Posts

Hi all,

 

I am creating a small custom php mvc framework that I can re-use in all of my projects.

 

So assuming that I am getting a request_uri of /customframework/aboutus how would I "parse" that in php to extract the aboutus or whatever else it might be from the string?

 

Also, is there a good way to ignore any trailing slashes if there are any? For example, if the request_uri was /customframework/aboutus/// I would still want to know just the aboutus in a string

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/238710-bootstrapping-how-to-parse-request_uri/
Share on other sites

There can be a fair bit more to it than simply parsing the url for different segments. It's not exactly something that would be easily described within a simple forum post.

 

I would take a look at some of the other frameworks and in particular there routing. If your looking for something simple to use as an example, my framework (Proem) linked to via the Github link in my signature has a fairly basic routing system (still incomplete).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.