title: How to fix Warning Illegal string offset in PHP
body: <p>I have this chunk of PHP code which is giving me the error: </p>
  
  <blockquote>
    <p><b>Warning</b>:  Illegal string offset 'iso_format_recent_works' in
    <b>C:\xampp\htdocs\Manta\wp-content\themes\manta\functions.php</b> on
    line <b>1328</b></p>
  </blockquote>
  
  <p>This is the code that the warning is relating to:</p>
  
  <pre><code>if(1 == $manta_option['iso_format_recent_works']){
      $theme_img = 'recent_works_thumbnail';
  } else {
      $theme_img = 'recent_works_iso_thumbnail';
  }
  </code></pre>
  
  <p>When I do an a <code>var_dump($manta_option);</code> I receive the follow result:</p>
  
  <blockquote>
    <p>["iso_format_recent_works"]=>   string(1) "1"</p>
  </blockquote>
  
  <p>I have tried casting <code>$manta_option['iso_format_recent_works']</code> to an <code>int</code> but still get the same issue.</p>
  
  <p>Any help would be greatly appreciated!</p>