title: Print Array Key => Value
body: <p>I have an array key => value and I printed it's content:</p>
  
  <pre><code>echo '&lt;pre&gt;';
  print_r($result);
  echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>and the content is:</p>
  
  <pre><code>Array
  (
      [restaurants] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [name] =&gt; The Star
                      [type] =&gt; Array
                          (
                              [0] =&gt; restaurant
                              [1] =&gt; food
                              [2] =&gt; casino
                              [3] =&gt; spa
                              [4] =&gt; lodging
                              [5] =&gt; point_of_interest
                              [6] =&gt; establishment
                          )
  
                      [vicinity] =&gt; 80 Pyrmont Street, Pyrmont
                  )
  
              [1] =&gt; Array
                  (
                      [name] =&gt; South Steyne
                      [type] =&gt; Array
                          (
                              [0] =&gt; restaurant
                              [1] =&gt; food
                              [2] =&gt; point_of_interest
                              [3] =&gt; establishment
                          )
  
                      [vicinity] =&gt; Harbourside Jetty, Darling Drive, Darling Harbour
                  )
  
              [2] =&gt; Array
                  (
                      [name] =&gt; ibis Sydney Darling Harbour
                      [type] =&gt; Array
                          (
                              [0] =&gt; restaurant
                              [1] =&gt; food
                              [2] =&gt; lodging
                              [3] =&gt; point_of_interest
                              [4] =&gt; establishment
                          )
  
                      [vicinity] =&gt; 70 Murray Street, Pyrmont
                  )
  
              [3] ...
  </code></pre>
  
  <p>I need to print the content's information with this form:</p>
  
  <blockquote>
    <p>Name: The Star<br>
    Type: food, casino, spa, lodging, point_of_interest, establishment<br>
    Address: 80 Pyrmont Street, Pyrmont</p>
  </blockquote>
  
  <p>But, when I access to the array with this code:</p>
  
  <pre><code>foreach ($result as $value){
      echo "Nome: ".$value["name"];
      echo "&lt;br&gt;";
      echo "Tipo: ";
      foreach($value-&gt;type as $valuearr){
          echo $valuearr["type"].", ";
      }
      echo "&lt;br&gt;";
      echo "Morada: ".$value["vicinity"];
      echo "&lt;br&gt;&lt;br&gt;";
  }
  </code></pre>
  
  <p>the result is:</p>
  
  <blockquote>
    <p>Name:<br>
    Type:<br>
    Address:</p>
  </blockquote>
  
  <p>What's the error in the code? </p>