【PHP】ファイル名を変数に代入するには? 投稿日:2015年4月7日 更新日:2015年4月7日 PHP 127文字:約1分 https://on-ze.com/blog/1096 Home Blog 【PHP】ファイル名を変数に代入するには? Ads by Google PHPで現在のファイル名を変数に代入したい場合のコードを紹介します。 <?php $filename = basename ($_SERVER["PHP_SELF"]); echo $filename; ?> 以上。簡単ですね〜。 ONZE 株式会社 オンズ 株式会社オンズ制作チーム。 ウェブサイト制作、デザイン制作でお悩みの際はお気軽にご相談ください。 https://on-ze.com Twitter Facebook Feedly LINE こちらの記事もいかがですか? アナタにオススメ! 同じカテゴリーの他の記事です。 【WordPress】テンプレートタグ[bloginfo]を使って出力できる情報。 【PHP】プログラムの処理に要した時間を計測する方法。 【jQuery + PHP】クロスドメイン対応版:Google Feed API の代替案を紹介します。 【WordPress】プラグイン無しで番号付きのページネーションを実装する方法 【PHP】文字列をハッシュ値に変換して暗号化する方法 【PHP】時間帯ごとに表示内容を変更する方法 【PHP】外部サイトのRSS情報を取得して表示させる方法。 WordPressの[404.php]などに設定しておくと便利な各種リダイレクトの方法。 Ads by Google