title: Error getting JSON object "Trying to get property of non-object"
body: <p>I'm having a problem getting values from a JSON object.
  The script is working normally using another JSON structure, however with this specific JSON file, the error is happening.
  I believe the error is in <strong><code>"" content ": ["</code></strong> at the beginning of JSON.</p>
  
  <p>I am using the following script:</p>
  
  <pre><code>&lt;?php
  $json_strdoc = file_get_contents("http://app.tce.ma.gov.br:8889/contratos/documentos?numeroContrato=03.004.0410");
  
      $objdoc = json_decode($json_strdoc);
  
     echo "
     &lt;table class='table tabela-nova'&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th scope='col' style='width: 28%;'&gt;Tipo de Documento&lt;/th&gt;
              &lt;th scope='col' style='width: 35.5%;'&gt;Descrição&lt;/th&gt;
              &lt;th scope='col'&gt;Data de Envio&lt;/th&gt;
              &lt;th scope='col'&gt;Baixar&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;";
  
  
          foreach ($objdoc as $itemdoc){
  
              echo "
      &lt;tr&gt;
              &lt;td&gt;".$itemdoc-&gt;content-&gt;documentos-&gt;tipoDocumento-&gt;nome."&lt;/td&gt;
              &lt;td&gt;".$itemdoc-&gt;content-&gt;documentos-&gt;assunto."&lt;/td&gt;
              &lt;td&gt;".$itemdoc-&gt;content-&gt;documentos-&gt;dataEnvio."&lt;/td&gt;
              &lt;td&gt;&lt;span class='baixar'&gt;&lt;i class='fa fa-angle-down'&gt;&lt;/i&gt;&lt;/span&gt;&lt;a class='link-baixar' target='_blank' href='$itemdoc-&gt;content-&gt;link'&gt; Baixar arquivo &lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
       " ;
          }
     echo "
      &lt;/tbody&gt;
     &lt;/table&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>However, the error is returning:</p>
  
  <pre><code>Notice: Trying to get property of non-object in...
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZhJ66.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZhJ66.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>The result should look like this:</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/U977k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U977k.png" alt="enter image description here"></a></p>