Php-function-chdir

提供:Dev Guides
移動先:案内検索

PHP-関数chdir()

構文

bool chdir ( string $directory )

定義と使い方

PHPの現在のディレクトリを、渡されたディレクトリに変更します。

パラメーター

Sr.No Parameter & Description
1

directory(Required)

新しい現在のディレクトリ

戻り値

成功するとTRUEを、失敗するとFALSEを返します。

以下は、この機能の使用法です-

<?php
   echo getcwd() . "\n";

   chdir('html');

   echo getcwd() . "\n";
?>

これは、次の結果を生成します-

/home/finddevguides
/home/finddevguides/html