You are here: Re: [PHP] array walk and class member functions « PHP « IT news, forums, messages
Re: [PHP] array walk and class member functions

Posted by Jochem Maas on 10/19/96 11:05

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>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация