Home  >  Article  >  Backend Development  >  php会嵌套么

php会嵌套么

WBOY
WBOYOriginal
2016-06-13 10:37:59908browse

php能嵌套么?
就是如果我有两个.php文件,其中一个是
require_once('login.php');
?>
另外一个login.php里面是
echo 'hello world';
?>
这样子第一个.php文件里的代码其实是两层这个东东,这个会出问题么?

------解决方案--------------------
这不会出问题,而且是必须要这样做!

require 实际的动作是
产生 ?>
载入文件
产生
------解决方案--------------------
这样没事..
------解决方案--------------------
require_once('login.php');
?>
另外一个login.php里面是
echo 'hello world';
?>

==>
require_once('login.php'); 他的作用就是把 login.php 内容(当然是没有他的) 都写入到当前php文件中, 然后在一起执行。

不会出问题。

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