XpertWorlock Posted March 31, 2011 Share Posted March 31, 2011 This one stumped me, but maybe someone has figured it out. I'm trying to write a script that is able to decide whether a remote url is a directory or a file, this is fine until it comes to mod_rewrite(rewritten?) urls. ex. http://www.example.com/test Now this could be test.php,test.html etc., but in the rare case, it could also be a folder (example.com/test/index.php). Anyone have any ideas? Link to comment https://forums.phpfreaks.com/topic/232269-if-remote-url-string-is-a-file-or-directory/ Share on other sites More sharing options...
QuickOldCar Posted March 31, 2011 Share Posted March 31, 2011 Run the url through this function http://php.net/manual/en/function.filetype.php Link to comment https://forums.phpfreaks.com/topic/232269-if-remote-url-string-is-a-file-or-directory/#findComment-1194848 Share on other sites More sharing options...
XpertWorlock Posted March 31, 2011 Author Share Posted March 31, 2011 Thanks for the reply, Correct me if I'm wrong, but I think filetype is for files on my server, unfortunately I'm looking to tell if a url on another server is a folder or not. Link to comment https://forums.phpfreaks.com/topic/232269-if-remote-url-string-is-a-file-or-directory/#findComment-1194854 Share on other sites More sharing options...
salathe Posted March 31, 2011 Share Posted March 31, 2011 You can't. Link to comment https://forums.phpfreaks.com/topic/232269-if-remote-url-string-is-a-file-or-directory/#findComment-1194905 Share on other sites More sharing options...
XpertWorlock Posted March 31, 2011 Author Share Posted March 31, 2011 Yeah I was on my last hopes when I started the thread, thanks for clearing that up for me. Link to comment https://forums.phpfreaks.com/topic/232269-if-remote-url-string-is-a-file-or-directory/#findComment-1195235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.