Re: global array, can't assign values from variables SOLVED
| From: | Chris Edwards | Date: | Fri, 05 Sep 2003 20:17:28 +0000 |
| Subject: | Re: global array, can't assign values from variables SOLVED | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161830@lists.php.net to get a copy of this message | ||
Hi
$data is not empty. It's obvious from the :
> > OUTPUT:
> > 9/6/2003
Anyways, it is overwriting itself because of begin and start tags. I didn't
realize that.
Thanks.
--
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
chris.edwards@obinet.com
http://www.OuterBanksInternet.com
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: "Chris Edwards" <chris.edwards@obinet.com>
Cc: <php-general@lists.php.net>
Sent: Friday, September 05, 2003 4:11 PM
Subject: Re: [PHP] global array, can't assign values from variables
> Chris Edwards wrote:
>
> > I'm just going to give the code and output. It should be self
explanatory.
> > The array, $criteria, is having the issue. I don't know what it's
doing. I
> > cannot seem to assign the value from the $data variable to the
> > $criteria[index] value. You will see some attempts to debug the
situation
> > which leads me to more puzzlement.
> >
> > CODE:
> >
> > // run when cdata is found
> > function characterDataHandler($parser, $data)
> > {
> > switch( $GLOBALS['currentTag'] )
> > {
> > case "MINSTARTDATE" : echo
$data;/*$GLOBALS['criteria']['minstartdate']
> > = $data;*/break;
> > case "MAXSTARTDATE" :
$GLOBALS['criteria']['maxstartdate'] =
> > "junk";/*$data;*/break;
> > case "MINSTAY" : $GLOBALS['criteria']['minstay'] =
$data; break;
> [snip]
> >
> > echo "<pre>\n";
> > print_r($criteria);
> > echo "</pre>\n";
> >
> >
> > OUTPUT:
> > 9/6/2003
> > Array
> > (
> > [maxstartdate] => junk
> > [minstay] =>
> [snip]
>
>
> $data is empty. How are you calling this function?
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>