title: how can i get multidimensional array values using foreach?
body: <p>I want to use a multidimensional array in different functions.so i am making it as a global variable(array).i created a multidimensional array and made it as global to access in different function.now how can i get the values from it using foreach loop?
  here is my code</p>
  
  <pre><code>$test=array(
         array(
          "input1"=&gt;"v1",
          "input2"=&gt;"v2"),
          array(
           "input3"=&gt;"v3",
           "input4"=&gt;"v4")
        );
  
  class testing
  {
    function testp()
    {
      global $test;
      foreach($test as $key =&gt; $value)
      {
        echo $value;
      }
      var_dump($test);
      echo is_array($test);
    }
  }
  
  $obj = new testing();
  $obj-&gt;testp();
  </code></pre>
  
  <p>i used is_array and <code>var_dump</code> to confirm whether its an array.
  all are fine
  and its shwoing <strong>Error suppression ignored</strong>. now how can i get the values from it?</p>