PHPのechoには省略表記があったのか。
2015/02/03
PHPのデバッグ時によく利用するのがechoです。
このecho文だけを出力する場合にはもっと短く表記することができます。
echoの記述例
普通はこんな感じで埋め込むことが多いと思います。
1 |
<?php echo 'Hello, World!'; ?> |
2015/02/03訂正
正: <?php
誤: <php
お詫びして訂正します。
上記は以下のように書くこともできます。
1 |
<?='Hello, World!'?> |
まぁ、あまりechoだけで埋め込むこともないので、
普段使いするかというと、微妙ではありますが知っておくと便利かも。
参考
Web業界で働くためのPHP入門(2):知らないと働けないPHPの基本文法/構文と注意点 (1/2) – @IT
PHPはPHP License (原文)に基づいて、
Open Source Initiativeに承認されライセンスされています。
関連記事
-
ローカル環境へのPHP設置
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
ローカル環境へのphpMyAdmin設置
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
(lounge mod_fcgid on 2.4.6)windowsでCGIをFastCGIで実行するように設定する
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
PHP.iniに設定する設定値はhttpd.confや.htaccessに対しても設定が可能
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
PHPを1行目の[#!php-cgi]を省いて(書かずに)CGI実行する方法
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
PHPをmod_fcgidやmod_fastcgiでFastCGI実行する方法
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
phpinfo.phpに表示されるLocal ValueとMaster Valueの違いとは
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
include_once(include) は戻り値が返されるの!?
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
ローカル環境へのPHP設置(Ver.PHP 5.5.5)
Google or AdMax Promotion(it) 禁断の機能がau公式 …
-
(mod_fcgid on 2.2.x)windowsでCGIをFastCGIで実行するように設定する
Google or AdMax Promotion(it) 禁断の機能がau公式 …