Re: array walk and class member functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jochem Maas wrote:
Tom wrote:

<snip>

Sorry Tom, I hit the send button too early!
I mean to add some context to the code below so you would (hopefully)
understand what I mean:


OR define the function outside of the class e.g.

function aFunction($value, $key)
{
global $aReturnString; $aReturnString = $aReturnString.$value;
}



...was meant to be:

function aFunction($value, $key)
{
    global $aReturnString;
    $aReturnString = $aReturnString.$value;
}

class aClass
{
    some other stuff, constructor etc
   public function aPublicFunction($anArray)
   {
      global $aRetrunString;
           function aFunction($value, $key)
      {
           global $aReturnString;
           $aReturnString = $aReturnString.$value;               }

      array_walk($anArray,'aFunction');
      return $aReturnString;
   }

   // rest of the class definition goes here...

	
<snip>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux