Change values ​​from array during iteration

array:

('abc', 'def', 'xyz')

foreach($arr as $item)
  // change $item here

Can I do this without creating an intermediate array?

+3
source share
1 answer

Use the link.

foreach($arr as &$item)
+10
source

All Articles