Unhandled Error!

Array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object

Document site:footer
Document type CMS partial
Line 20
Exception class Cms_ExecutionException

Code Highlight

curl_setopt($c1, CURLOPT_RETURNTRANSFER, true);
 
$response = curl_exec($c1);
 
$tweet = json_decode($response);
 
if(array_key_exists(0, $tweet))
  $tweet = $tweet[0]->text; // show latest tweet
else
  $tweet = '';
?>
      <img class="left" src="<?= root_url('/') ?>resources/images/twidget.png" />
      <p class="right"><?= $tweet ?></p>
# Document Type
2 site:footer CMS partial
1 Non-Fluid CMS template