Jump to content

Getting Full Path


seb hughes

Recommended Posts

Did you look at dirname() and friends?  There are some user comments there, too, that may be helpful in your situation.  Basically, you may want something like:

 

if (stripos('http://',$string) === 0) {
// URL (http://www.example.com/folder1/folder2/file.html)
$parts = explode('/',rtrim('http://',$string));
} else {
// Filesystem (c:\folder1\folder2\file.txt)
$parts = explode(DIRECTORY_SEPARATOR,$string);
}

 

That's just an example; it can probably be written better for your exact purpose.

Link to comment
https://forums.phpfreaks.com/topic/52956-getting-full-path/#findComment-261543
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.