Reputation: 2149
I have three files:
inner.php
is included inside outer.php
and innermost.php
is further included inside inner.php
innermost.php
has a condition in it that needs to stop execution of inner.php
but not outer.php
Calling return
will end execution of innermost.php
but not inner.php
In other words, how can I skip execution from an included file of the immediate file it was included in.
Upvotes: 1
Views: 104
Reputation: 29985
I suppose you could check the return value of innermost.php
:
if ((include 'inermost.php') != true) {
return false;
}
Do make sure to return true;
in innermost.php
Upvotes: 2