I have 2 blocks of code....
// 1st block
<div id="a1">
<?php
if (is_array($new_array) || is_object($new_array))
{
foreach ($new_array as $name => $val)
{
echo $name . " : " . $val[0] . " , " . $val[1]. " , " . $val[2];
}
}
unset($new_array);
?>
</div>
2nd block
<div id="a2">
<?php
if (is_array($new_array) || is_object($new_array))
{
foreach ($new_array as $name => $val)
{
echo $name . " : " . $val[0] . " , " . $val[1]. " , " . $val[2];
}
}
unset($new_array);
?>
</div>
Either 1st or 2nd Block will give empty results in a day. Means if Today , 1st block will give empty result & tomorrow 2nd Block will give empty result.... Alternatively....
Issue :
Today, Value is empty for 2nd block , it gave Notice: Undefined variable: new_array error , so I initialized this before 2nd block of code :
$new_array='';
it worked fine.... but tomorrow 2nd block code will give this result :
Warning: Illegal string offset , Fatal error: Uncaught Error: Cannot use string offset as an array
So i need to remove this code : $new_array=''; before 2nd block & i need to place before 1st block.....