Sam
Sam

Reputation: 7058

If statement continuing outside include?

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!

Upvotes: 3

Views: 150

Answers (1)

Emil Vikström
Emil Vikström

Reputation: 91983

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';
}

Upvotes: 2

Related Questions