ciber Posted June 27, 2010 Share Posted June 27, 2010 I want to extract the path from a url string, how do I do this?? I included an example below to describe what I mean. input : http://www.remotesite.com/images/folder/image.jpg php magic happens output : /images/folder/image.jpg thanks. Quote Link to comment https://forums.phpfreaks.com/topic/206007-get-file-path-from-url-string/ Share on other sites More sharing options...
Alex Posted June 27, 2010 Share Posted June 27, 2010 echo parse_url('http://www.remotesite.com/images/folder/image.jpg', PHP_URL_PATH); parse_url Quote Link to comment https://forums.phpfreaks.com/topic/206007-get-file-path-from-url-string/#findComment-1077965 Share on other sites More sharing options...
ciber Posted June 27, 2010 Author Share Posted June 27, 2010 tks Quote Link to comment https://forums.phpfreaks.com/topic/206007-get-file-path-from-url-string/#findComment-1077969 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.