PHP Functions
| From: | Karl DeSaulniers | Date: | Sat, 31 Oct 2015 08:08:47 +0000 |
| Subject: | PHP Functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-325232@lists.php.net to get a copy of this message | ||
Hello all,
Given the following function writing technique.
$vehiclesOutput = function($newVhcls=array(), $header=true) {
...
};
Everything was ok till I put another function in below it in a similar fashion.
(Assigning the function to a variable like so)
Then I got this error.
Function name must be a string
but only on the second function and not all the time. It's weird.
My first question is obvious. Am I doing this wrong?
I got this way of writing functions from another coder online in my researching.
So this is not my creation per se. I know about declaring function before the name way as well, just
liked this style better I guess.
If it is the correct way, what is happening?
Sorry if this is a newbie question, but I haven't fully molted yet.
If there is a doc I should be looking at, please provide gently if you could.
TIA
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com