코드 스 니펫에 설명 된 PHP 비헤이비어의 이유는 무엇입니까?PHP 동작 : PHP 태그의 코드가 화면에 표시되지 않는 이유는 무엇입니까?
// "demo.txt" is a plain text file.
// Content is read into a string.
$demo = file_get_contents('http://example.com/demo.txt');
// Browser displays the content of the text-file.
echo $demo;
// "functions.php" is a php-file.
// Read into a string.
$demo = file_get_contents('http://example.com/functions.php');
// Browser displays nothing.
echo $demo;
어떤 동작입니까? – Damodaran
질문 할 때 달성하고자하는 것과 현재 완료 한 것에 대한 구체적인 예를 제공해주십시오. 훌륭한 질문에 대해 자세히 알아 보려면 질문하는 방법 - http://stackoverflow.com/questions/을 참조하십시오. how-to-ask – Damodaran
HTTP를 통해 PHP 파일을 요청할 때 일반적으로 서버에 의해 파싱되므로 PHP 스크립트가 생성하는 출력 (있는 경우) 만 출력됩니다. 출력을 생성하지 않으면 적절하게 utput을 얻지 못합니다. 생각하지 않는다면 PHP 파일의 변수에 저장할 수있는 데이터베이스 암호 등을 읽을 수 있습니다. – CBroe