我有一個看起來像這樣的數(shù)組:[ { "positional_index":"1.3", "sourceid":10409, "language": "Malayalam", "field_gita_10409_text": "Behold, O Teacher! this mighty army of the sons of Pandu, arrayed by the son of Drupada, thy wise disciple." }, { "positional_index":"1.2", "sourceid":10409, "language": "Devanagari", "field_gita_10409_text": "1.1 Dhritarashtra said What did my people and the sons of Pandu do when they had assembled together eager for battle on the holy plain of Kurukshetra, O Sanjaya." },]我應該使用 foreach 循環(huán)來訪問每個鍵。例如,如果 key = field_gita_10409_text,我必須使用 php 中的 explode() 函數(shù)來提取值 10409 等。在這種情況下,我不知道如何使用 foreach 循環(huán),因為該數(shù)組包含 2 個關聯(lián)數(shù)組。請告訴我。
循環(huán)由關聯(lián)數(shù)組組成的數(shù)組
慕田峪7331174
2022-01-08 14:58:48