1. 包含文件:
text.txt当中的内容是: sonikk
include(dirname(__FILE__)."\\text.txt");
include(".\\text.txt");
include("./text.txt");
实验:
text.php当中的内容是: sonikk
<?php
$a = true;
if( $a )
{
require("./text.php"); echo "<br/>";
require_once("./text.php"); echo "<br/>";
}
if($a)
{
include_once("./text.php"); echo "<br/>";
include_once("./text.php"); echo "<br/>";
}
?>
输出结果只有一个sonikk
2. escape
echo <<<EOD
<?xml version="1.0"?>
...all sorts of XML goes here...
Nothing will affect the output of this code until:
EOD;