How does include('./code.php'); work? I understand it is the equivalent of having the code “pasted” directly where the include occurs, but, for example:
If I have two pages, page1.php and page2.php, of which I would need to manipulate different variables and functions in ./code.php, does include() create a copy of ./code.php, or does it essentially link back to the actual page ./code.php?
See the manual.
If you
includea text file, it will show as text in the document.includedoes not behave like copy-paste:test.php
test.txt
The example above will output:
If you are going to include PHP files, you still need to have the PHP tags
<?phpand?>.Also, normally parentheses are not put after
include, like this: