Scooby08 Posted July 2, 2010 Share Posted July 2, 2010 I'm looking for a simple way to remove the top directory from a path like so: /one/two/1.php Then I would like to remove "/one" so the path would now be like so: /two/1.php Thanks for any suggestions! Link to comment https://forums.phpfreaks.com/topic/206554-how-to-remove-top-directory-from-path/ Share on other sites More sharing options...
Cagecrawler Posted July 2, 2010 Share Posted July 2, 2010 <?php $path = '/one/two/1.php'; echo substr($path, strpos($path, '/', 1)); Link to comment https://forums.phpfreaks.com/topic/206554-how-to-remove-top-directory-from-path/#findComment-1080415 Share on other sites More sharing options...
Scooby08 Posted July 2, 2010 Author Share Posted July 2, 2010 Lovely! Thank You Link to comment https://forums.phpfreaks.com/topic/206554-how-to-remove-top-directory-from-path/#findComment-1080416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.