Reputation: 532
What is the difference between realpath($path)
and is_dir($path)
?
I know realpath
follows symbolic links, but is there a performance difference between the two?
Upvotes: 0
Views: 1137
Reputation: 18665
How about looking at the manual.
realpath — Returns canonicalized absolute pathname
is_dir — Tells whether the filename is a directory
Upvotes: 0
Reputation: 1885
Realpath returns the canonicalized actual pathname of a file on success, is_dir returns a boolean value of whether or not the file is a directory.
http://php.net/manual/en/function.is-dir.php
http://php.net/manual/en/function.realpath.php
Upvotes: 6