A statement to include a file looks like this:
Why is it not like this?
You mean "parentheses"
Any way, parentheses are used for functions. include (and a few other things) are -not- functions, as you yourself said, they're "statements".
So you don't need to use the parenthess. Many do use them, which adds to the misconception many have. But that's the lowdown.
An include is a language construct, which is why the parentheses is optional.
On a side note, when you include a file without a full path name, add ./ in front of the name, to avoid PHP first checking any include folders setup in the ini file.
You can check out the other language constructs PHP has here:
Yes, he said so in the title Joke aside, he is from Ireland and they normally say brackets and not parentheses there (UK, Australia and perhaps other countries as well).
Thanks for the much better explanation @TheRedDevil;
I can overlook the brackets vs. parentheses thing seeing as I should have said language construct but said statement :shifty:
Thanks Mittineague and TheRedDevil for the helpful explanations and links.
Yes we do, sorry for the confusion
This topic is now closed. New replies are no longer allowed.