开发者

If statement continuing outside include?

开发者 https://www.devze.com 2023-01-03 01:26 出处:网络
I\'ve got an index.php 开发者_运维知识库page, and a lot of includes on it. How can I make an if statement from the first include continue to the last include, without getting an Parse error: syntax er

I've got an index.php 开发者_运维知识库page, and a lot of includes on it. How can I make an if statement from the first include continue to the last include, without getting an Parse error: syntax error, unexpected $end error.

Thanks!


You can't. You can however put the things inside the if statement in its own file and include it inside the if statement like this:

if(...) {
   include 'file1.php';
}
0

精彩评论

暂无评论...
验证码 换一张
取 消