I found a strange behavior in PHP foreach
foreach ($webshopOrders as $webshopOrder) {
foreach ($webshopOrder['products'] as $product) {
$product['item_no'] = preg_replace('/...my pattern.../', $myNewValue, $product['item_no']);
// here the item_no contains the new, right value
}
}
// here the item_no contains the original value
Why isn't changed the value permanently in the foreach and how can I set the value to use outside the foreach loop too?