[nycphp-talk] Object Methods and Properties
Chris Bielanski
Cbielanski at inta.org
Tue Jul 27 16:28:43 EDT 2004
I like Phil's approach way better than when I considered a solution using
eval();
Thanks,
Chris Bielanski
Web Programmer,
International Trademark Association,
1133 Avenue of the Americas, 33rd Floor
New York, NY 10036
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org
INTA -- 125 Years of Excellence
> -----Original Message-----
> From: Phillip Powell [mailto:phillip.powell at adnet-sys.com]
> Sent: Tuesday, July 27, 2004 4:26 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Object Methods and Properties
>
>
> Joe Crawford wrote:
>
> >i have things like this
> >
> >class MyClass {
> > var $_header;
> > var $_body;
> > var $_footer;
> >}
> >
> >and i am trying to use that code to dynamically choose which
> variable to
> >change.
> >
> >
>
> I've had luck with PHP 4.3.2 doing this:
>
> if ($append) $this->{'_' . $part} .= $val;
>
> Phil
>
More information about the talk
mailing list