Is this a bug?
| From: | Stig N�rgaard Jepsen | Date: | Wed, 15 Aug 2001 17:19:25 +0000 |
| Subject: | Is this a bug? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62875@lists.php.net to get a copy of this message | ||
Hello,
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;};
};
};
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');
?>