Is there any elegant way to check if a file was included by using include/include_once/require/require_once or if the pag
include
include_once
require
require_once
Here's a different idea. Just include the file whenever you need it. Inside the include file you can decide whether it needs to include the contents: