PHP ファイルパスに関して

ファイルパスを分解して使用したい場合


<?php
  $file = "/hoge/aaaaa/index.php";
  // 親ディレクトリのパスの抽出  ”/hoge/aaaaa”
  $dirName = pathinfo($file, PATHINFO_DIRNAME);
  // ファイル名の抽出  ”index.php”
  $baseName = pathinfo($file, PATHINFO_BASENAME);
  // 拡張子無しファイル名の抽出  "index"
  $fileName = pathinfo($file, PATHINFO_FILENAME);
  // 拡張子の抽出  ”php”
  $extension = pathinfo($file, PATHINFO_EXTENSION);
?>