I have two files
1 – index.php
2 – main.php
index.php call to main.php by <?php require_once("../../includes/main.php"); ?>
How do I know from main.php when it executes,
if index.php calls to him or the same user executes it Standalone?
What should I ask inside main php to continue running the program if was require_once?
Another approach is to use
get_included_files()– the “main” file that included the other ones will always show up on top = be the 0th element of the returned array:This will work in most cases.