PHP가 새로워졌습니다. 문법에 관한 서적을 읽었을지라도 heredoc에 대한 좌절스러운 문제가 있습니다. 아래 텍스트는 들여 쓰기가되지 않아야합니다.heredoc가 들여 쓰기 또는 작동하지 않아야 함
<?php
$text="Mike's";
echo <<<_END
<!--END is just like double quoteing a var..
You can use single/double quotes without having to escape them first; inside
END. The last _END tag, has to be on the start of new line with nothing allowed
to procede it, not even whitespace-->
This is the $text 'first line'.
This is the $text 'second line'.
This is the $text 'third line'.
_END;
?>
무엇을 기대 했습니까? 이거 말고? http://codepad.org/kp7Ba18a – Gordon
예, 책의 제안대로? –
책의 내용은 무엇입니까? 답변을 원할 경우 실제 질문을해야합니다. 지금 당장 당신은 단지 "doesnt work"라고 말하고 있지만 그것이 작동하지 않는 방법이나 오히려 출력을 기대하는 방법을 말하지 않습니다. 링크드 코드 패드의 출력은 어떻게 보일 것인가입니다. 당신은 그것이 들여 쓰기되어야하고 어떻게해야한다고 생각합니까? – Gordon