PHP has include and require_once which are equivalent to JSP’s include directive(<%@ include ..%>)
JSP also has a jsp:include which only includes the output from the included file, keeping the included file in a servlet of its own.
I am looking for something similar in PHP, so that the main page’s variables and other content don’t mess with those of the included files.
Does one exist?
An easy solution is to include the file inside a function to prevent the scope of the file from littering the global namespace.