File::stripLeadingSeparators()

File::stripLeadingSeparators() – パスから先頭のセパレータを取り除く

Synopsis

require_once 'File.php';

string File::stripLeadingSeparators ( string $path , string $separator = = DIRECTORY_SEPARATOR )

Description

このメソッドは、パス名から先頭のセパレータ (*nixでは "/" のような) を取り除きます。

Parameter

  • string $path - 先頭のセパレータを取り除くパス名を指定します。

  • string $separator - セパレータを定義するオプション文字列を指定します。 このパラメータのデフォルト値は、PHP であらかじめ定義されている DIRECTORY_SEPARATOR 定数の値です。

Return value

このメソッドは、 先頭のディレクトリセパレータが取り除かれたパス名を返します。

Note

This function can be called statically.

Example

File::stripLeadingSeparators() の使用

<?php
require_once "File.php";

echo 
File::stripLeadingSeparators("/home/foo/lala/");
?>

この例は、home/foo/lala/ を表示します。