@fayd55

Как обработать данные?

Здравствуйте! Есть ответ с GET запроса такого вида:
{"length":"427","pages":9,"column":["number","date_call","did","uniqueid","called_num","bitrix24_task_id"],"missed":[["89114554810","2020-03-14 22:41:12","4012988400","1584214872.30675","1",null],["79216152585","2020-03-14 21:15:48","9884606666","1584209748.30670","9884606666",null],["89118594567","2020-03-14 20:53:46","4012988400","1584208426.30668","100",null],["89622655393","2020-03-14 17:59:17","4012988400","1584197957.30616","",null],["89024141707","2020-03-14 15:05:05","4012988400","1584187505.30478","",null],["89216133504","2020-03-14 14:30:55","4012988400","1584185455.30397","100",null],["89114511733","2020-03-14 12:29:15","4012988400","1584178155.30310","",null],["89114606973","2020-03-13 20:15:48","4012988400","1584119748.30234","4012988400",null],["89118635507","2020-03-13 19:39:09","4012988400","1584117549.30178","",null],["89371524210","2020-03-13 19:07:24","4012988400","1584115644.30149","4012988400",null],["560826","2020-03-13 12:19:43","4012988400","1584091183.29721","4012988400",null],["89632999930","2020-03-13 09:58:22","4012988400","1584082702.29540","",null],["79520541450","2020-03-12 16:33:15","79114800651","1584019995.29345","79114800651",null],["8104917654861198","2020-03-12 13:56:42","4012988400","1584010602.29010","",null],["74957831772","2020-03-12 12:30:09","9884606666","1584005409.28895","9884606666",null],["89052411999","2020-03-12 12:30:09","4012988400","1584005409.28894","100",null],["79062114488","2020-03-12 12:08:23","9884606666","1584004103.28891","1",null],["89114774930","2020-03-11 10:58:41","4012988400","1583913521.27967","4012988400",null],["84959743581","2020-03-10 22:22:04","4012988400","1583868124.27874","100",null],["89632955505","2020-03-10 19:51:50","4012988400","1583859110.27862","100",null],["89211053476","2020-03-10 19:27:39","4012988400","1583857659.27840","4012988400",null],["89211033655","2020-03-10 15:42:49","4012988400","1583844169.27619","4012988400",null],["89216036803","2020-03-10 13:58:11","4012988400","1583837891.27284","4012988400",null],["89114577114","2020-03-10 13:19:11","4012988400","1583835551.27181","",null],["79128177816","2020-03-10 13:14:22","9884606666","1583835262.27159","9884606666",null],["79113221788","2020-03-10 11:17:05","9884606666","1583828225.26895","9884606666",null],["89062128495","2020-03-09 08:44:14","4012988400","1583732654.26208","4012988400",null],["89097770045","2020-03-08 20:09:45","4012988400","1583687385.26197","4012988400",null],["89097826356","2020-03-08 17:21:21","4012988400","1583677281.26177","4012988400",null],["89114666546","2020-03-08 14:46:21","4012988400","1583667981.26151","4012988400",null],["89506733392","2020-03-08 13:43:30","4012988400","1583664210.26144","100",null],["89118605648","2020-03-08 12:09:25","4012988400","1583658565.26121","4012988400",null],["89114923982","2020-03-07 18:56:27","4012988400","1583596587.26092","1",null],["89062370791","2020-03-07 11:10:27","4012988400","1583568627.25657","4012988400",null],["74954078387","2020-03-07 10:01:30","9884606666","1583564490.25612","100",null],["79097815992","2020-03-07 09:45:54","9884606666","1583563554.25606","100",null],["89097973777","2020-03-06 21:29:17","4012988400","1583519357.25589","",null],["89114582940","2020-03-06 19:29:21","4012988400","1583512161.25574","4012988400",null],["89316062423","2020-03-06 08:39:04","4012988400","1583473144.24893","4012988400",null],["89003457968","2020-03-06 03:15:35","4012988400","1583453735.24851","4012988400",null],["79629956736","2020-03-05 21:57:30","79114800651","1583434650.24848","1",null],["79097977718","2020-03-05 19:08:38","9884606666","1583424518.24809","100",null],["74956631414","2020-03-05 13:31:41","9884606666","1583404301.24331","",null],["89114572318","2020-03-04 19:01:23","4012988400","1583337683.24128","100",null],["89062196881","2020-03-04 18:25:03","4012988400","1583335503.23973","4012988400",null],["89114556525","2020-03-03 21:11:10","4012988400","1583259070.23194","100",null],["89062357563","2020-03-03 21:10:31","4012988400","1583259031.23192","100",null],["89097863225","2020-03-03 16:08:48","4012988400","1583240928.23004","100",null],["79062330202","2020-03-03 13:28:38","9884606666","1583231318.22630","100",null],["89632967993","2020-03-02 20:50:04","4012988400","1583171404.22152","4012988400",null]]}


подскажите каким путем я могу загнать данные в переменные? Смотрю в сторону регулярных выражений , но что то мне подсказывает что я пытаюсь лечить простату через горло.
  • Вопрос задан
  • 71 просмотр
Решения вопроса 2
l3ftoverz
@l3ftoverz Куратор тега PHP
Люблю Финский металкор
я пытаюсь лечить простату через горло.

В точку.

json_decode()
Ответ написан
@NedoKoder
Как то так:
$data = '{"length":"427","pages":9,"column":["number","date_call","did","uniqueid","called_num","bitrix24_task_id"],"missed":[["89114554810","2020-03-14 22:41:12","4012988400","1584214872.30675","1",null],["79216152585","2020-03-14 21:15:48","9884606666","1584209748.30670","9884606666",null],["89118594567","2020-03-14 20:53:46","4012988400","1584208426.30668","100",null],["89622655393","2020-03-14 17:59:17","4012988400","1584197957.30616","",null],["89024141707","2020-03-14 15:05:05","4012988400","1584187505.30478","",null],["89216133504","2020-03-14 14:30:55","4012988400","1584185455.30397","100",null],["89114511733","2020-03-14 12:29:15","4012988400","1584178155.30310","",null],["89114606973","2020-03-13 20:15:48","4012988400","1584119748.30234","4012988400",null],["89118635507","2020-03-13 19:39:09","4012988400","1584117549.30178","",null],["89371524210","2020-03-13 19:07:24","4012988400","1584115644.30149","4012988400",null],["560826","2020-03-13 12:19:43","4012988400","1584091183.29721","4012988400",null],["89632999930","2020-03-13 09:58:22","4012988400","1584082702.29540","",null],["79520541450","2020-03-12 16:33:15","79114800651","1584019995.29345","79114800651",null],["8104917654861198","2020-03-12 13:56:42","4012988400","1584010602.29010","",null],["74957831772","2020-03-12 12:30:09","9884606666","1584005409.28895","9884606666",null],["89052411999","2020-03-12 12:30:09","4012988400","1584005409.28894","100",null],["79062114488","2020-03-12 12:08:23","9884606666","1584004103.28891","1",null],["89114774930","2020-03-11 10:58:41","4012988400","1583913521.27967","4012988400",null],["84959743581","2020-03-10 22:22:04","4012988400","1583868124.27874","100",null],["89632955505","2020-03-10 19:51:50","4012988400","1583859110.27862","100",null],["89211053476","2020-03-10 19:27:39","4012988400","1583857659.27840","4012988400",null],["89211033655","2020-03-10 15:42:49","4012988400","1583844169.27619","4012988400",null],["89216036803","2020-03-10 13:58:11","4012988400","1583837891.27284","4012988400",null],["89114577114","2020-03-10 13:19:11","4012988400","1583835551.27181","",null],["79128177816","2020-03-10 13:14:22","9884606666","1583835262.27159","9884606666",null],["79113221788","2020-03-10 11:17:05","9884606666","1583828225.26895","9884606666",null],["89062128495","2020-03-09 08:44:14","4012988400","1583732654.26208","4012988400",null],["89097770045","2020-03-08 20:09:45","4012988400","1583687385.26197","4012988400",null],["89097826356","2020-03-08 17:21:21","4012988400","1583677281.26177","4012988400",null],["89114666546","2020-03-08 14:46:21","4012988400","1583667981.26151","4012988400",null],["89506733392","2020-03-08 13:43:30","4012988400","1583664210.26144","100",null],["89118605648","2020-03-08 12:09:25","4012988400","1583658565.26121","4012988400",null],["89114923982","2020-03-07 18:56:27","4012988400","1583596587.26092","1",null],["89062370791","2020-03-07 11:10:27","4012988400","1583568627.25657","4012988400",null],["74954078387","2020-03-07 10:01:30","9884606666","1583564490.25612","100",null],["79097815992","2020-03-07 09:45:54","9884606666","1583563554.25606","100",null],["89097973777","2020-03-06 21:29:17","4012988400","1583519357.25589","",null],["89114582940","2020-03-06 19:29:21","4012988400","1583512161.25574","4012988400",null],["89316062423","2020-03-06 08:39:04","4012988400","1583473144.24893","4012988400",null],["89003457968","2020-03-06 03:15:35","4012988400","1583453735.24851","4012988400",null],["79629956736","2020-03-05 21:57:30","79114800651","1583434650.24848","1",null],["79097977718","2020-03-05 19:08:38","9884606666","1583424518.24809","100",null],["74956631414","2020-03-05 13:31:41","9884606666","1583404301.24331","",null],["89114572318","2020-03-04 19:01:23","4012988400","1583337683.24128","100",null],["89062196881","2020-03-04 18:25:03","4012988400","1583335503.23973","4012988400",null],["89114556525","2020-03-03 21:11:10","4012988400","1583259070.23194","100",null],["89062357563","2020-03-03 21:10:31","4012988400","1583259031.23192","100",null],["89097863225","2020-03-03 16:08:48","4012988400","1583240928.23004","100",null],["79062330202","2020-03-03 13:28:38","9884606666","1583231318.22630","100",null],["89632967993","2020-03-02 20:50:04","4012988400","1583171404.22152","4012988400",null]]}';
$json_arr = json_decode($data, true);
print_r($json_arr);
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@zkrvndm
Веб-разработчик
То что вы написали называетя JSON и практически в каждом языке программирования есть инструменты для работы с ним, просто воспользуйтесь поиском.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы