Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私がファイルパスを持っているとしましょう-
Doc/Monday/File.txt
File.txtsubstr()を使用してPHPだけで選択したいと思います。それ、どうやったら出来るの?
File.txt
basename('/some/path/to/file.txt');
「/」を使用して文字列を分解し、結果の配列の最後の要素を取得します
これを試して
$data= pathinfo('/some/path/to/file.txt'); echo $data['basename'];