Home  >  Article  >  Backend Development  >  PHP学习(6) 包含代码和嵌入PHP

PHP学习(6) 包含代码和嵌入PHP

WBOY
WBOYOriginal
2016-06-23 14:29:46982browse

包含代码 在PHP中,包含代码有四个函数,include include_once require require_once。 include和require的主要区别是,如果文件不存在require函数会抛出一个致命错误,而include只会抛出一个警告。 include include_once 以及 require require_once,其中后缀为once的表示如果代码已经包含该文件,不再再次引用该文件。 嵌入PHP 在HTML中嵌入PHP有四种方法:XML形式、SGML形式、ASP形式、脚本形式。其中ASP形式默认是不支持的,必须在PHP配置文件[PHP.ini]中,修改asp_tags为On。四种方法示例代码如下: 123456789101112 // XML形式 // SGML形式 echo 'Hello, world'; ?> // ASP形式 // 脚本形式

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn