File::skipRoot()

File::skipRoot() – strips the root directory from a given path

Synopsis

require_once 'File.php';

string File::skipRoot ( string $path )

Description

This method strips the root directory from $path.

Parameter

string $path - the path to be processed.

Return value

If the path is absolute, this method returns the processed path, otherwise, it returns the path untouched.

Note

This function can be called statically.

Example

Using File::skipRoot()

<?php
require_once 'File.php';

echo 
File::skipRoot("/home/foo/bar");
?>

This example prints out home/foo/bar.

rewinds a file pointer (Previous) strip leading separators from a path (Next)
Last updated: Sat, 20 Sep 2014 — 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.