Looping a multidimensional array in php

前端 未结 3 1457
醉酒成梦
醉酒成梦 2020-11-27 23:09

I have a multidimensional array like this:

array(2) {
  [1]=>
  array(3) {
    [\"eventID\"]=>
    string(1) \"1\"
    [\"eventTitle\"]=>
    string         


        
3条回答
  •  無奈伤痛
    2020-11-27 23:35

    The foreach statement will take care of all of this for you, including the associative hashes. Like this:

    foreach($array as $value) {
        foreach($value as $key => $val) {
            if($key == "links") {
    
            }
            /* etc */
        }
    }
    

提交回复
热议问题