|
Posted by Tony on 06/06/05 18:35
"pauld" <pdc124@yahoo.co.uk> wrote in message
news:1118071029.252822.297460@f14g2000cwb.googlegroups.com...
> reset($array);
> foreach($array as $key =>$value)
> { $array[$key] = 0;}
>
> didn't reset the array values to 0;
>
> Im stuck :-((
>
Are you trying to reset the VALUES?
Say, you have an array: ( carrots=>3, tomatoes=>5, oranges=>6, apples=>2 ) -
you want all those values set to 0 -
try this:
foreach($array as $value) {
$value = 0;
}
Then you should have ( carrots=>0, tomatoes=>0, oranges=>0, apples=>0 )
[Back to original message]
|