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

- Thread: https://externals.io/message/12223
- Original archive: https://news-web.php.net/php.internals/12223
- Started by Hannes Magnusson on 2004-08-18T19:26:37+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12223 — Hannes Magnusson — 2004-08-18T19:26:37+00:00

URL: https://externals.io/message/12223#12223

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
