Fynn Pfingsten Ответов: 2

Выберите ID из массива в PHP


у меня есть следующий массив:

[{"is_disable": false, "canbus_id": "", "daily_mileage": "79.91", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "238822.9094", "temp_min": 0, "sim_number": "89490200001222280318", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140169", "beacon_id": 357454070966716, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224812", "type": 75, "price": "13.90", "added_by": 30, "latest_signal_id": 11355797905, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295768204, "trip_status": 0, "added_at": "2016-08-11 17:12:48", "device_id": 1000016558, "name": "100", "transmission": "94.4678427307", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 16:55:15"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "150.67", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "225937.487", "temp_min": 0, "sim_number": "89490200001222287305", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76098470", "beacon_id": 356173068452528, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "06652243", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355887514, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295798931, "trip_status": 0, "added_at": "2016-07-18 13:17:22", "device_id": 1000014684, "name": "101", "transmission": "104.754475821", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:10:47"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "0.00", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "0.0", "temp_min": 0, "sim_number": "89490200001222280326", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140180", "beacon_id": 357454070966583, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224827", "type": 75, "price": "13.90", "added_by": 30, "latest_signal_id": 4750866162, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 4750866162, "trip_status": 0, "added_at": "2016-08-11 17:13:14", "device_id": 1000016559, "name": "102", "transmission": "0.00440216064456", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2016-10-14 13:55:18"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "0.07", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "128979.53", "temp_min": 0, "sim_number": "89490200001222287297", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76098477", "beacon_id": 356173068339048, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "06651413", "type": 75, "price": "13.90", "added_by": 30, "latest_signal_id": 11355870182, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295786522, "trip_status": 0, "added_at": "2016-07-18 13:17:43", "device_id": 1000014686, "name": "103", "transmission": "48.0815112933", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:07:45"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "70.99", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "254239.5951", "temp_min": 0, "sim_number": "89490200001222280359", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140179", "beacon_id": 357454070716954, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224797", "type": 79, "price": "13.90", "added_by": 30, "latest_signal_id": 11355918544, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295758804, "trip_status": 0, "added_at": "2016-08-11 17:14:07", "device_id": 1000016562, "name": "104", "transmission": "96.7045163633", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:16:23"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "21.90", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "304073.034", "temp_min": 0, "sim_number": "89490200001222287578", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76139406", "beacon_id": 357454070965718, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224814", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355847968, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295842023, "trip_status": 0, "added_at": "2016-08-11 17:15:00", "device_id": 1000016565, "name": "105", "transmission": "143.196938239", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:03:52"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "0.01", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "165283.731", "temp_min": 0, "sim_number": "89490200001222280342", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140192", "beacon_id": 357454070969520, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224692", "type": 79, "price": "13.90", "added_by": 30, "latest_signal_id": 11355852062, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295781428, "trip_status": 0, "added_at": "2016-08-11 17:13:40", "device_id": 1000016561, "name": "106", "transmission": "70.0273424265", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:04:36"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "0.20", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "266959.607", "temp_min": 0, "sim_number": "89490200001222287313", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76098469", "beacon_id": 356173068153878, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "06651372", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355874474, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295834810, "trip_status": 0, "added_at": "2016-07-18 13:17:31", "device_id": 1000014685, "name": "107", "transmission": "115.902919835", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:08:30"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "195.53", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "161626.859", "temp_min": 0, "sim_number": "89490200001222287552", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76139402", "beacon_id": 357454070915093, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224580", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355921729, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295784845, "trip_status": 0, "added_at": "2016-08-11 17:15:28", "device_id": 1000016567, "name": "108", "transmission": "73.3666257757", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:16:56"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "184.19", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "279374.912", "temp_min": 0, "sim_number": "89490200001222280300", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140165", "beacon_id": 357454070970668, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224690", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355917436, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295736315, "trip_status": 0, "added_at": "2016-08-11 17:12:33", "device_id": 1000016557, "name": "109", "transmission": "124.144438329", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:16:11"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "177.45", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "295268.3739", "temp_min": 0, "sim_number": "89490200001222280367", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140191", "beacon_id": 357454070716905, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224790", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355884005, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295677707, "trip_status": 0, "added_at": "2016-08-11 17:14:29", "device_id": 1000016563, "name": "110", "transmission": "128.90077938", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:10:11"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "32.75", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "259966.202", "temp_min": 0, "sim_number": "89490200001222287537", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76139386", "beacon_id": 357454070967342, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224668", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11353333075, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295377119, "trip_status": 0, "added_at": "2016-08-11 17:14:44", "device_id": 1000016564, "name": "111", "transmission": "117.01760193", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 11:16:43"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "5.18", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "123291.79", "temp_min": 0, "sim_number": "89490200001222280334", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140174", "beacon_id": 357454071042285, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224706", "type": 79, "price": "13.90", "added_by": 30, "latest_signal_id": 11355900678, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295826697, "trip_status": 0, "added_at": "2016-08-11 17:13:28", "device_id": 1000016560, "name": "115", "transmission": "59.4283460756", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:13:10"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "95.18", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "8248.518", "temp_min": 0, "sim_number": "89430103119128000590", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 30, "gsm_number": "873640059", "beacon_id": 356173068704688, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "06652294", "type": 79, "price": "13.90", "added_by": 67, "latest_signal_id": 11355778714, "gsm_areacode": "43688", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295706585, "trip_status": 0, "added_at": "2019-12-19 14:46:10", "device_id": 1000075422, "name": "116", "transmission": "3.34102061169", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 16:52:07"}]
Я хочу захватить "latest_signal_id" из данного "device_id". Как это сделать?

Спасибо за вашу помощь

Что я уже пробовал:

Искал в google но так и не решил проблему

2 Ответов

Рейтинг:
13

Luc Pattyn

Это должно дать вам некоторое вдохновение; я сократил Ваш массив и поместил его в одинарные кавычки в первой строке:

	$json=
'[{"is_disable": false, "canbus_id": "", "daily_mileage": "79.91", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "238822.9094", "temp_min": 0, "sim_number": "89490200001222280318", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140169", "beacon_id": 357454070966716, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224812", "type": 75, "price": "13.90", "added_by": 30, "latest_signal_id": 11355797905, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295768204, "trip_status": 0, "added_at": "2016-08-11 17:12:48", "device_id": 1000016558, "name": "100", "transmission": "94.4678427307", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 16:55:15"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "150.67", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "225937.487", "temp_min": 0, "sim_number": "89490200001222287305", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76098470", "beacon_id": 356173068452528, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "06652243", "type": 120, "price": "13.90", "added_by": 30, "latest_signal_id": 11355887514, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 11295798931, "trip_status": 0, "added_at": "2016-07-18 13:17:22", "device_id": 1000014684, "name": "101", "transmission": "104.754475821", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2020-07-06 17:10:47"}, {"is_disable": false, "canbus_id": "", "daily_mileage": "0.00", "command_internal_number": "", "tank_height": "0", "immobilizer_status": 0, "garmin_check_driver": 0, "velocity_info": 0, "latest_mileage": "0.0", "temp_min": 0, "sim_number": "89490200001222280326", "canbus_serial": "", "deleted_at": "None", "sap_status": 1, "user_id": 152620, "latest_engine_hour": 0, "tank_capacity": null, "temp_max": 0, "gsm_number": "76140180", "beacon_id": 357454070966583, "note": "", "canbus_program_nr": "", "activation": 0, "car_state": "", "serial_number": "07224827", "type": 75, "price": "13.90", "added_by": 30, "latest_signal_id": 4750866162, "gsm_areacode": "0151", "tank_capacity_lt": 0, "latest_zone_id": -1, "hide_status": false, "latest_geofence_signal_id": 4750866162, "trip_status": 0, "added_at": "2016-08-11 17:13:14", "device_id": 1000016559, "name": "102", "transmission": "0.00440216064456", "box_type": 22, "start_date": "None", "latest_task_record_id": 0, "command_password": "", "canbus_type": "", "latest_geocode_sent_at": "2016-10-14 13:55:18"}]';
	
	$arr=json_decode($json);
	
	foreach($arr as $obj) {
		$device_id = $obj->device_id;
		$latest_signal_id = $obj->latest_signal_id;
		echo "<p>$device_id = $latest_signal_id</p>";
	}


Он генерирует

1000016558 = 11355797905

1000014684 = 11355887514

1000016559 = 4750866162


и это должно помочь тебе начать.


Fynn Pfingsten

Привет, Спасибо! Это работает. У меня есть еще один вопрос, у меня есть еще один массив, который не имеет тега "[" в начале. Он начинается непосредственно с "{". Проблема в том, что в результате получается много тегов"=".

Luc Pattyn

Это был ваш пятый вопрос.
Каждый раз, когда на вопрос "что я пробовал" отвечали что-то вроде "искал в google, но не нашел решения проблемы"

Вы не показываете ни кода, ни сообщений об ошибках, ничего. Никаких признаков того, что ты действительно что-то пытаешься сделать.

А теперь скажите мне, что код, который я вам дал, или какой-то его вариант, "работает". Я хочу услышать, что вы провели некоторые исследования и теперь понимаете, почему и как это работает. Тогда вы добились бы некоторого прогресса и были бы лучше подготовлены к ответам на свои собственные вопросы...


Если вы новичок в программировании, или в языке, или в каком-то конкретном аспекте программного обеспечения, то начните с чтения нескольких глав в книге на эту тему. Сделайте усилие, попытайтесь научиться. Мы здесь не для того, чтобы кормить вас с ложечки.

Удачи.

Fynn Pfingsten

Спасибо за ваш ответ! Google или другие платформы не дают мне ответа. Спасибо большое за ваш код, вы мне очень помогли. и я попытался решить эту проблему сам с помощью нового массива, но не получил его. потому что [ отсутствует в начале, и я не знаю, как работает декодирование массива. так ты можешь мне помочь или нет?

Luc Pattyn

Почему вы настаиваете на том, чтобы называть его массивом, вы же сами сказали, что он не начинается с скобки.
Вы вообще знаете, что такое JSON? вы читали документацию по json_decode?
сделайте некоторые исследования, пока вы этого не сделаете, я больше не буду отвечать.

Fynn Pfingsten

$json2=
'{"canbus_engine_temp": "", "signal_id": 11354658214, "input_2_voltage": 0.0, "canbus_doors": "", "nr_sat": 18, "signal_strenght": 12, "canbus_fuel_consumption": "", "beacon_id": 356173068452528, "input_6": 0, "input_7": 0, "input_4": 0, "input_5": 0, "input_2": 0, "input_3": 0, "input_0": 0, "input_1": 0, "canbus_total_driving_time": "", "dec_long": 9, "canbus_fuel_level_pr": "", "mileage": 225937.4844, "canbus_lights": "", "canbus_device_state": "", "canbus_total_engine_hours": "", "canbus_fuel_level_lt": "", "canbus_total_fuel_used": "", "dec_lat": 52, "input_1_voltage": 12.7, "speed_km": 0.0, "canbus_info_indicators": "", "geocode_sent_at": "2020/07/06 14:10:47", "added_at": "2020-07-06 14:10:51", "signal_mode": 2, "canbus_fuel_range": "", "canbus_total_idle_fuel_use": "", "signal_type": 4, "canbus_engine_rpm": ""}';

$arr2=json_decode($json2);

foreach($arr2 as $obj2) {
$device_id2 = $obj2->dec_long;
$latest_signal_id2 = $obj2->dec_lat;
Эхо "$device_id2 = $latest_signal_id2";
}

Fynn Pfingsten

Вот код, который я пробовал, но он не работает, пожалуйста, помогите мне решить эту проблему!

Fynn Pfingsten

Я читал статью о json поэтому думаю что знаю что это такое

Рейтинг:
0

Andre Oosthuizen

В вашем массиве есть много идентификаторов, поэтому я не уверен, на какой из них вы ссылаетесь.

Кроме того, вы не упомянули, где хранится массив, в сеансе или другом месте?

Вызов ключа и значения массива -

$myArray = $_SESSION['theIDname'];
echo $myArray;


Также не говоря уже о том, хотите ли вы получить все идентификаторы массива или только определенный, циклический или нет.