[nycphp-talk] Object Methods and Properties
Joe Crawford
jcrawford at codebowl.com
Tue Jul 27 16:27:36 EDT 2004
i tried eval and it tells me that i cannot return a printed value ;)
Joe Crawford Jr.
On Tue, 2004-07-27 at 16:28, Chris Bielanski wrote:
> 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
> >
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
>
>
More information about the talk
mailing list