$_POST= Array ( [0] => aaa@gmail.com [1] => bbb [2] => ccc [3] => ddd [4] => eee [5] => fff [6] => ggg [7] => hhh [8] => iii [9] => jjj [10] => 31 [11] => k ) foreach($_POST as $key => $val){ for ($key = 0; $key <= 9;$key++){ $_POST2[$val] = htmlentities($_POST[$val]); […]
Я получил многомерный массив следующим образом: Totalarray ( [0] => Array ( [city] => NewYork [cash] => 1000 ) [1] => Array ( [city] => Philadelphia [cash] => 2300 ) [2] => Array ( [city] => NewYork [cash] => 2000 ) ) и я хотел бы суммировать значение [cash] суб-массивов, которые получили одинаковое значение [city] […]