> I have this code, which is a cooked down code of something bigger. So
don't
> ask what it's for.
> The problem is that I can't get this script working the way I like it at
> all. Maybe it's a bug. Maybe you have another suggestion?
> Somewhere in the middle section i have wrote test1 and test2 as a comment.
> If you activate test2 instead of test1, then you will have some output(not
> the expected output), else I just see a page saying:"The page cannot be
> displayed".
>
> I think it's very strange, any ideas?
> Try inserting this into a file and try yourself.
>
> /Stig
>
> <?
> $side = 1;
>
> function grabkeys ($felt, $key, $side) {
>     global $newarray;
>     $stopkey = array ("A","Z");//De key-navne som den ikke skal gemme.
>     If (!in_array($key , $stopkey)) {
>       if ($felt == $side) { $newarray[] = $key;};
>     };
> };

Get rid of ; after }  They are silly.

You could probably make $stopkey 'static', since it never seems to change.

> function showkeys ($felt, $key) {
>     global $newarray;
>     echo count($newarray) . "-count newarray<br>"; //
>     echo "<pre>" . $newarray[0] . "</pre>-newarray<br>"; //test2
>     echo $newarray[0] . "-newarray<br>"; //test1
> };
>
> $row = array
> ("A"=>"1","B"=>"1","C"=>"1","D"=>"1","E"=>"1","F"=>"1","Z"=>"1");
> array_walk ($row, 'grabkeys', $side);
> array_walk ($row, 'showkeys');
> ?>

Hrm...  I seem to be getting sensible output *EXCEPT* that $newarray[0]
seems to take on 'A' through 'Z' as you walk through $row with 'showkeys'...
Seems pretty broken to me...

But I'm using 4.0.2-dev on this machine...

Is this the output you are getting with a current release?
http://bugs.php.net may be the place to go...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to