Posted by David Haynes on 05/30/06 18:35
iavian wrote:
> hi
>
> i want to modify an array in foreach loop
>
> foreach($array as $ele){
> $ele = $some_random_string;
> }
>
> i should see here the modified $array .
>
> thnaks in advance
>
foreach( $array as &$ele ) {
$ele = $some_random_string;
}
should work as you want it to.
-david-
Navigation:
[Reply to this message]
|