Sum of values in an array

I’ve adapted a simple shopping cart script to produce estimates on the fly. The original script did not total the contents of the shopping cart and I am struggling with this. The script below only puts the last item of the array in the total. Can anyone help? Thanks.

<form action="" method="post" name="shoppingcart">
	<?php 
    //We want to include the shopping cart in the email
    ob_start();
    ?>
    <table width="500" border="1">
      <tr>
        <th scope="col">&nbsp;</th>
        <th scope="col">Item Name</th>
        <th scope="col">Unit Price</th>
        <th scope="col">Qty</th>
        <th scope="col">Cost</th>
      </tr>
    
        <?php 
        //Print all the items in the shopping cart
        foreach ($_SESSION['SHOPPING_CART'] as $itemNumber => $item) {
        ?>
        <tr id="item<?php echo $itemNumber; ?>">    
            <td><a href="?remove=<?php echo $itemNumber; ?>">remove</a></td>
            <td><?php echo $item['name']; ?></td>
            <td><?php echo $item['price']; ?></td>
            <td><input name="items_qty[<?php echo $itemNumber; ?>]" type="text" id="item<?php echo $itemNumber; ?>_qty" value="<?php echo $item['qty']; ?>" size="2" maxlength="3" /></td>
            [COLOR="Red"][B]<td><?php $itemtotal =  $item['qty'] * $item['price']; echo $itemtotal; ?></td>[/B] [/COLOR]       
        </tr>

        <?php
        }
        ?>
[COLOR="red"][B]        <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
        <td><strong>Total</strong></td><td><strong><?php $total_all = array($itemtotal);  
 echo array_sum($total_all) ?></strong></td></tr>[/B][/COLOR]
    </table>
	<?php $_SESSION['SHOPPING_CART_HTML'] = ob_get_flush(); ?>
    <p>
      <label>
      <input type="submit" name="update" id="update" value="Update Cart" />
      </label>
    </p>
</form>

The value of $itemtotal is being reset every pass of the foreach loop. Maybe create a $runningtotal (or call it $total_all) that adds the value of $itemtotal to itself on every foreach and use that. No need for array_sum().

Thanks, I will try that