現在の位置: ホーム> 関数カテゴリ一覧> 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
類似の関数
  • ファイルを特定の長さに切り捨てます ftruncate

    ftruncate

    ファイルを特定の長さに切り捨てます
  • ファイルまたはディレクトリの名前を変更します rename

    rename

    ファイルまたはディレクトリの名前を変更し
  • ファイルポインターから行を読み取ります fgets

    fgets

    ファイルポインターから行を読み取ります
  • ファイルに書き込む(バイナリファイルで安全に使用される) fwrite

    fwrite

    ファイルに書き込む(バイナリファイルで安
  • 指定されたファイル名が書き込み可能かどうかを判断します is_writable

    is_writable

    指定されたファイル名が書き込み可能かどう
  • パターンでファイル名を一致させます fnmatch

    fnmatch

    パターンでファイル名を一致させます
  • stream_set_write_bufferのエイリアス set_file_buffer

    set_file_buffer

    stream_set_write_buf
  • 新しいディレクトリを作成します mkdir

    mkdir

    新しいディレクトリを作成します