現在の位置: ホーム> 関数カテゴリ一覧> dirname

dirname

パスのディレクトリパーツに戻ります
名前:dirname
カテゴリ:ファイルシステム
対応言語:php
一言説明:パスのディレクトリ名部分を返します。

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">dirname</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"c:/testweb/home.php"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token keyword">echo</span> <span class="token function">dirname</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"/testweb/home.php"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

出力:

 C:/testweb
/testweb
類似の関数
  • ファイルの所有者を取得します fileowner

    fileowner

    ファイルの所有者を取得します
  • ファイルのイノードを取得します fileinode

    fileinode

    ファイルのイノードを取得します
  • ファイルへの変更を同期する(メタデータを含む) fsync

    fsync

    ファイルへの変更を同期する(メタデータを
  • 一意のファイル名でファイルを作成します tempnam

    tempnam

    一意のファイル名でファイルを作成します
  • RealPathキャッシュエントリを取得します realpath_cache_get

    realpath_cache_get

    RealPathキャッシュエントリを取得
  • link()またはunset()を参照してください(PHPにはキーワードや関数の削除がありません) delete

    delete

    link()またはunset()を参照し
  • ファイルパス情報を返します pathinfo

    pathinfo

    ファイルパス情報を返します
  • ファイルの最後のアクセス時間を取得します fileatime

    fileatime

    ファイルの最後のアクセス時間を取得します