title: Foreach from array json data
body: <p>I get an array in JSON format and I decode this data. I can access to single data by selecting e.g. echo $myArray[0]["name"]; 
  However, I want to do a loop to iterate all names and prices from the array. Can you support me to find the bug in my code?</p>
  
  <pre><code>$url = "myurl";
  $response = file_get_contents($url);
  $myArray = json_decode($response, true);
  
  
  foreach ($myArray as $product) {
      echo $product-&gt;name . '&lt;br&gt;';
  }
  </code></pre>
  
  <p>and here is a sample of the array:</p>
  
  <pre><code>[{
      "id": 782,
      "name": "Test Translation New",
      "price": "1",
      "image": {
          "url": "xxx/image-2.jpg",
          "position": 0
      },
      "link": "https:xxx",
      "nickname": "newmarker"
  }, {
      "id": 777,
      "name": "Test Translation",
      "price": "0",
      "image": {
          "url": "https:xxx/image-1.jpg",
          "position": 0
      },
      "link": "https:xxx",
      "nickname": "newmarker"
  }]
  </code></pre>