У меня есть result array
в php. Я хочу подсчитать значения на основе нескольких ключевых значений. Например:Количество значений на основе нескольких значений ключа в php
Я хочу, чтобы посчитать весь отъезд, который принадлежит «fromcity» => Лахор и «tocity» => Сахивале
А также же все остальное fromcity и tocity отсчитывает вылет.
Как группа по заявлению.
Просьба помочь мне в этом.
У меня есть следующий результирующий массив в PHP:
$result_array = array
(
[0] => array
(
"id" => "348",
"departure" => "00:00:00",
"fromcity" => "Lahore",
"tocity" => "Buhawalpur"
)
[1] => array
(
"id" => "531",
"departure" => "00:00:00",
"fromcity" => "Lahore",
"tocity" => "Murree"
)
[2] => array
(
"id" => "532",
"departure" => "00:00:00",
"fromcity" => "Lahore",
"tocity" => "Rawalpindi"
)
[3] => array
(
"id" => "581",
"departure" => "00:00:00",
"fromcity" => "Lahore",
"tocity" => "Multan"
)
[4] => array
(
"id" => "582",
"departure" => "00:00:00",
"fromcity" => "Lahore",
"tocity" => "Sahiwal"
)
[5] => array
(
"id" => "528",
"departure" => "00:05:00",
"fromcity" => "Lahore",
"tocity" => "Sahiwal"
)
[6] => array
(
"id" => "1584",
"departure" => "00:15:00",
"fromcity]" => "Lahore",
"tocity]"=> "Multan"
)
[7] => array
(
"id" => "1586",
"departure" => "00:15:00",
"fromcity"=> "Lahore",
"tocity" => "Sahiwal"
)
[8] => array
(
"id" => "349",
"departure" => "01:00:00",
"fromcity" => "Lahore",
"tocity" => "Multan"
)
[9] => array
(
"id" => "529",
"departure" => "01:00:00",
"fromcity" => "Lahore",
"tocity" => "Sahiwal"
)
[10] => array
(
"id" => "906",
"departure" => "01:00:00",
"fromcity" => "Lahore",
"tocity" => "Rawalpindi"
)
[11] => array
(
"id" => "685",
"departure" => "01:45:00",
"fromcity" => "Lahore",
"tocity" => "Rawalpindi"
)
[12] => array
(
"id" => "350",
"departure" => "02:00:00",
"fromcity" => "Lahore",
"tocity" => "Multan"
)
[13] => array
(
"id" => "530",
"departure" => "02:00:00",
"fromcity" => "Lahore",
"tocity" => "Sahiwal"
)
[14] => array
(
"id" => "907",
"departure" => "02:30:00",
"fromcity" => "Lahore",
"tocity" => "Rawalpindi"
)
[15] => array
(
"id" => "736",
"departure" => "03:15:00",
"fromcity" => "Lahore",
"tocity" => "Sahiwal"
)
[16] => array
(
"id" => "908",
"departure" => "05:30:00",
"fromcity" => "Lahore",
"tocity" => "Rawalpindi"
)
[17] => array
(
"id" => "1649",
"departure" => "05:30:00",
"fromcity"=> "Lahore",
"tocity" => "Faislabad"
)
[18] => array
(
"id" => "331",
"departure" => "06:00:00",
"fromcity" => "Lahore",
"tocity" => "Multan"
)
[19] => array
(
"id" => "438",
"departure" => "06:00:00",
"fromcity" => "Lahore",
"tocity" => "Sialkot"
)
[20] => array
(
"id" => "447",
"departure" => "06:00:00",
"fromcity" => "Lahore",
"tocity" => "Daska"
)
)
Измените свой вопрос, чтобы включить свои попытки достижения желаемого результата. – Epodax