Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/top_msg.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/php/function/pathinfo/pathinfo.php on line 20
Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/top_msg.php' for inclusion (include_path='.:/usr/local/php/7.4/lib/php') in /home/users/2/moriya-h5/web/confrage/php/function/pathinfo/pathinfo.php on line 20
目次 |
---|
・pathinfo ・サンプルコード ・サンプル |
インデックスとして指定する文字列 | 取得される情報 | |
dirname | ディレクトリ名 | |
basename | ファイル名+拡張子 | |
extension | 拡張子 |
(php部) <?php // ファイルのフルパスを設定 $fullpath = "C:\Program Files\Sun\JavaDB/index.html"; // ファイルの情報を取得 $fileinfo = pathinfo($fullpath); // フルパス表示 print "フルパス表示"; print "$fullpath"; // ディレクトリ名表示 print "ディレクトリ名表示"; print "$fileinfo[dirname]"; // ファイル名+拡張子表示 print "ファイル名+拡張子表示"; print "$fileinfo[basename]"; // 拡張子表示 print "拡張子表示"; print "$fileinfo[extension]"; ?>