php.ajax.coder Posted March 29, 2009 Share Posted March 29, 2009 I have a path C:/Folder/Folder/../file.txt is there a php function to evaluate to C:/Folder/file.txt Link to comment https://forums.phpfreaks.com/topic/151565-solved-file-path/ Share on other sites More sharing options...
MadTechie Posted March 29, 2009 Share Posted March 29, 2009 Huh! Link to comment https://forums.phpfreaks.com/topic/151565-solved-file-path/#findComment-796060 Share on other sites More sharing options...
php.ajax.coder Posted March 29, 2009 Author Share Posted March 29, 2009 C:/Folder/Folder/../file.txt is the same as C:/Folder/file.txt but i need to evaluate the first to the second to be displayed Link to comment https://forums.phpfreaks.com/topic/151565-solved-file-path/#findComment-796069 Share on other sites More sharing options...
Silverado_NL Posted March 29, 2009 Share Posted March 29, 2009 u could find out the current location of the running file with $_SERVER["SCRIPT_FILENAME"], then use the explode version to put em into an array like this. $array = explode('/',$_SERVER["SCRIPT_FILENAME"]); then from there u can work to the path u want using php's array functions and then implode em back together. Link to comment https://forums.phpfreaks.com/topic/151565-solved-file-path/#findComment-796074 Share on other sites More sharing options...
corbin Posted March 29, 2009 Share Posted March 29, 2009 realpath Link to comment https://forums.phpfreaks.com/topic/151565-solved-file-path/#findComment-796099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.