NYCPHP Meetup

[nycphp-talk] Disappearing data or I've gone mad

Jeremy Hise jhise at nextsource.com
Wed Feb 12 18:04:53 EST 2003


Hmmmm..ok cool. I'll try it from that angle.

Thanks Chris.

On Wed, 12 Feb 2003 17:12:56 -0500
Chris Snyder <chris at psydeshow.org> wrote:

> Jeremy Hise wrote:
> 
> >     function parse() {
> >        // Get an array of items such as 'first_name', 'last_name', etc
> >        $kws = $this->get_tags();
> >
> >        // If we do have an array of keywords
> >        if(is_array($kws)) {
> >            // For each keyword
> >            foreach($kws as $kw) {
> >                // Get the value from this object's data hasa
> >                $value = $this->data["$kw"];  // <-- this has no data in it inside this loop
> >                // Replace the smac tagged keyword with the value
> >                $this->body = ereg_replace("<smac>".$kw."</smac>", $value, $this->body);
> >            }
> >        }
> >        return($this->body);
> >    }
> >
> >  
> >
> I'd focus on the array ($kws) actually returned by $this->get_tags().
> It seems like your code would only work if the $kws array had keys named 
> after your keywords, and not values named after them. In other words, 
> make sure
> 
> foreach( $kws as $key=>$value ) {
>     print "$key=>$value";
>     }
> 
> isn't saying something like:
> 
> 0=>first_name
> 1=>email
> 
> etc.
> 
>     chris.
> 
> -- 
> HIP HOP CLOWN MONTH
> booth of the day: all day, every day
> http://hiphopclown.org/berylium/showcase/
> 
> 
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 


-- 

-+----------------------+
 | jhise at nextsource.com |
 | developer            |
 | nextSource, Inc.     |
 | x334                 |
 +----------------------+



More information about the talk mailing list