PHP - How can I check if return() was called from an include()'d file?
11:36 29 Mar 2010

How can I tell if return() was called from within the included file. The problem is that include() returns 'int 1', even if return() wasn't called. Here is an example...

included_file_1.php

included_file_2.php

main.php

Edit: As a temporary solution, I'm catching the output from include() (from echo/print statements). If any output was produced, I ignore the return value from include().

Not pretty, but it provides the functionality I need in my web app/framework.

php include