Checking if file is on localhost or not, implent optional argument to file_exists() ?

php.internals

Hannes Magnusson

22 years ago
Since PHP5 many/most filesystem functions can be used with "some" URL wrappers. That's good and all *but* now it's quite difficult to check if file is on localhost or not. It´s possible to use parse_url() and check if "scheme" is set for instance but I belive we should insert new optional argument to file_exists(), is_file() and is_dir() etc. example; bool file_exists ( string filename [, bool strict ] ) where strict is default to false but when true only check if filename exists on localhost. Agree? Or is there a simpler/better way of doing this? - Hannes