PHP Multidimensional Array Access

前端 未结 1 1504
不知归路
不知归路 2021-01-29 16:37

Say I have a multidimensional array in PHP such as:

this_array= array(
    string_name=>\'string\', 
    string_array=>array(
        \'string_key\'=>\'         


        
相关标签:
1条回答
  • 2021-01-29 16:58

    Code should look something like this, if you were intending on using strings as your keys.

    $this_array= array(
         'string_name' => 'string', 
        'string_array' => array(
            'string_key' => 'string_val'
        )
    );
    

    Yes, you will access it by:

    $this_array['string_array']['string_key'];
    
    0 讨论(0)
提交回复
热议问题