답변 3개
PHP에서는 엔터를 쳐서 내려가도 실제 출력되는 html구문에는 엔터가 안나옵니다. 강제적으로 break line을 출력할 때 사용합니다.
$a="asdf";
$b="ghjk";
echo $a.PHP_EOL.$b;
를 하면
asdf
ghjk
가 되는것이죠
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
End Of Line 으로 일고 있습니다
5.0.2에서 추가된 예약상수인 것으로
php.net에서는 아래와 같이 설명하고 있네요.
PHP_EOL (http://php.net/manual/en/language.types.string.php">string)
사용예는 그누보드에도 많이 있지만...
PHP_EOL can be used like that:
<?php
$data = 'some data'.PHP_EOL;
$fp = fopen('somefile', 'a');
fwrite($fp, $data);
?>
Which is the same of \r\n or \n depending on the OS.
You can put those lines in a while for example, and create a log file.
http://php.net/manual/en/reserved.constants.php">http://php.net/manual/en/reserved.constants.php 참조
답변에 대한 댓글 1개
답변 감사합니다.^^
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인