How do I create a text splitter script in PHP?

Hi TechGuru! I am currently developing an MVC using PHP for my school project. I need a text splitter script which is able to take the URI, and split it using / and or and returning specific strings to be used in my controllers. I am able to handle it at the point that the controllers are supposed to pick it up. I need this help urgently. Thanks.
