Re: PHP Functions

From: Date: Sat, 31 Oct 2015 08:43:35 +0000
Subject: Re: PHP Functions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-325233@lists.php.net to get a copy of this message
Sorry for the spam people. Looks like I was echoing $vehicleOutput() instead of $vehiclesOutput() with an "s". Still, if this is the incorrect way of doing this please let me know. I want to plan my code so others can work with it with "some" ease. TIA Best, Karl DeSaulniers Design Drumm http://designdrumm.com On Oct 31, 2015, at 3:08 AM, Karl DeSaulniers <karl@designdrumm.com> wrote: > 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 > > >

« previous php.general (#325233) next »