【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 こちらの記事もいかがですか? アナタにオススメ! 同じカテゴリーの他の記事です。 【PHP】数字の表記を[number_format]で3桁のカンマ区切りにする。 【PHP】特定の Instagram の投稿写真を[Instagram Graph API]を利用してウェブサイトに表示させる方法(v7.0対応) TwitterをRSS化できるサイト[nitter]を利用して、ウェブサイトにツイートのリストを表示させる方法 【PHP】シンプルなアクセス・カウンターを設置する方法。 【WordPress】テンプレートタグ[bloginfo]を使って出力できる情報。 【PHP】プログラムの処理に要した時間を計測する方法。 【WordPress】プラグイン無しで番号付きのページネーションを実装する方法 【PHP】RSSの日時データ「pubDate」と「dc:date」を取得・表示するときの注意点。 Ads by Google