Skip to content

Instantly share code, notes, and snippets.

@natali
Created July 7, 2010 07:53
Show Gist options
  • Save natali/466443 to your computer and use it in GitHub Desktop.
Save natali/466443 to your computer and use it in GitHub Desktop.
<?php
$total = 0;
$array1 = Array ( [tgl] => 07 [01] => 968 [total] => 35801 [02] => 29413 [03] => 731 [04] => 1172 [05] => 799 [06] => 1046 [07] => 1672 );
$array2 = Array ( [tgl] => 07 [01] => 820 [total] => 10949 [02] => 6042 [03] => 1067 [04] => 946 [05] => 915 [06] => 834 [07] => 325 );
// versi sederhana
unset($array1['tgl']);
$total += array_sum($array1);
unset($array2['tgl']);
$total += array_sum($array2);
// versi sedikit kompleks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment