trekerboy Posted September 2, 2007 Share Posted September 2, 2007 Hello, I am trying to write a snippet of code that will get the parent directory of a given string. For example, the string might be $string = "/public_html/images/" and I need something that will return "/public_html/". Any advice is appreciated! - Jason Link to comment https://forums.phpfreaks.com/topic/67595-solved-how-to-get-parent-directory-from-string/ Share on other sites More sharing options...
trekerboy Posted September 2, 2007 Author Share Posted September 2, 2007 Got it. Use dirname($string) Link to comment https://forums.phpfreaks.com/topic/67595-solved-how-to-get-parent-directory-from-string/#findComment-339567 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.