Answer the question
In order to leave comments, you need to log in
How to get a new array after comparing two arrays?
Hello!!
Please do not kick me, I'm self-taught .. and now I just can't understand how I can compare two arrays and get two new arrays based on the comparison.
I would be very grateful for your help!
So there are two arrays:
$fin_array = Array
(
[Номер телефона] => +79609998877
[Номер карты] =>
[Номер трека] =>
[Фамилия] => Пасюков
[Имя] => Сергей
[Отчество] =>
[Пол] => М
[Дата рождения] => 22.09.1906
[Возраст] => 32
[Ранг] => Серебряный
[Проц инд бонуса] => 0.00
[Проц инд скидки] => 0.00
[Комментарий] =>
[Средний чек] => 1.00
[Количество чеков] => 1
[Частота посещений] => 0.00
[Сумма чеков] => 1.00
[Оплачено деньгами] => 1.00
[Бонусов потрачено] => 0.00
[Бонусов накоплено] => 0.00
[Баланс бонусов] => 0.08
[Последний заказ] => 20.06.2017
[Первый заказ] => 20.06.2017
[ПолОтзывы] => 1
[ОтрОтзывы] => 0
[Дата регистрации] => 20.06.2017
[Анкета заполнена] => Нет
[Дата заполнения анкеты] =>
[Email] => [email protected]
[Cогласие на email] => Да
[Телефон подтвержден] => Да
[Cогласие на SMS] => Нет
[Cогласие на push] => Да
[Источник] => Front
[Источник (Админ)] => API старых фронтов
);
$temp_cont_arr= Array
(
[Номер телефона] => +79291112233
[Имя] => Анна Самойлова
);
Answer the question
In order to leave comments, you need to log in
if ($fin_array['Номер телефона'] === $temp_cont_arr['Номер телефона']) {
$newData = array_merge($fin_array, $temp_cont_array);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question