fergal — 2014-04-24T15:43:50-04:00 — #1
A statement to include a file looks like this:
Why is it not like this?
mittineague — 2014-04-24T15:50:58-04:00 — #2
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.
thereddevil — 2014-04-24T17:55:37-04:00 — #3
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).
mittineague — 2014-04-24T18:17:00-04:00 — #4
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:
fergal — 2014-04-25T14:35:20-04:00 — #5
Thanks Mittineague and TheRedDevil for the helpful explanations and links.
Yes we do, sorry for the confusion