HOME > PHP > PHP_EOLは改行コードを自動判別してくれる行末文字

PHP_EOLは改行コードを自動判別してくれる行末文字

phpの勉強や解説メモを見ていたら登場した「PHP_EOL」。PHP のコアで定義済みの定数で行末文字とのこと。テキストファイルなんかで表示される「↓」のことかな?

使用例

<?php
echo  '<ul>' . PHP_EOL;
?>

こんなふうに、htmlを整えたい時に使うと便利。

参考サイト


    Warning: Undefined array key "HTTP_REFERER" in /home/xs241045/ridesign.jp/public_html/lib/wp/wp-content/themes/libridesign2017/single-post.php on line 54

Warning: Undefined array key "HTTP_REFERER" in /home/xs241045/ridesign.jp/public_html/lib/wp/wp-content/themes/ridesignjp2016/relatedLinks.php on line 10