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. 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'], '/')); 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 Link to comment https://forums.phpfreaks.com/topic/193031-matching-all-forward-slashes/#findComment-1016755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.