9three Posted February 23, 2010 Share Posted February 23, 2010 Hi, I'm trying to match the following: preg_match('//', $_SERVER['REQUEST_URI'], $matches); print_r($matches); So that it looks like: If REQUEST_URI is /dev/example/me then it would match ->dev ->example ->me etc So I did '//' but its not working :-/ Can someone lend a hand? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/193031-matching-all-forward-slashes/ Share on other sites More sharing options...
Daniel0 Posted February 23, 2010 Share Posted February 23, 2010 $parts = explode('/', trim($_SERVER['REQUEST_URI'], '/')); Quote Link to comment https://forums.phpfreaks.com/topic/193031-matching-all-forward-slashes/#findComment-1016690 Share on other sites More sharing options...
9three Posted February 23, 2010 Author Share Posted February 23, 2010 Ah I had used explode but without trim and it didn't work correctly. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/193031-matching-all-forward-slashes/#findComment-1016755 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.