Re: Re: Still cnanot figure out with much easier example...
| From: | Jason Wong | Date: | Mon, 31 Jan 2005 01:10:19 +0000 |
| Subject: | Re: Re: Still cnanot figure out with much easier example... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207730@lists.php.net to get a copy of this message | ||
On Monday 31 January 2005 07:09, news.php.net wrote:
> $as = array();
> $a10 = "10";
> $a20 = "20";
>
> $a = &$a10;
> $arr[] = &$a;
> $a = &$a20;
> $arr[] = &$a;
>
> print_r($arr);
> foreach($arr as $a)
> {
> echo $a;
> }
If you do:
foreach($arr as $b)
{
echo $b;
}
then it will work as you expect it.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts