File::isAbsolute() – checks wether the given path is an absolute path


require_once 'File.php';

bool File::isAbsolute ( string $path )


This method checks whether the supplied path is an absolute path (eg. "/foo/bar" or "C:\foo\bar").


string $path - the path the will be checked.

Return value

This method returns TRUE if the path is absolute, FALSE otherwise.


This function can be called statically.


Using File::isAbsolute()

require_once 'File.php';

if (
File::isAbsolute("/usr/local") {
"Path is absolute";
} else {
"Path isn't absolute";

This short example will output the string 'Path is absolute'.

returns a path to a temporary file (Previous) read bytes from a file (Next)
Last updated: Sat, 28 Nov 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.