I hava a php page where i have a function which does not print or echo to the page it returns a variable called content which is rendered on an html page. Throughout out this function i am appending to the content variable.
i have an array ($myArray) which looks like
Array ( [0] => Array ( [0] => 2011-11-12 [1] => 1963-02-29 [3] => 2029-05-14 [9] => 1812-08-12 [11] => 1537-05-17 [16] => 2005-17-04 [30] => 3000-42-99 ) )
I am trying to loop through each item in $myArray and have it returned to the screen as a h1.
foreach($myArray as $item ){
$content .= '<h1>'.$item.'</h1>';
}
This results in me getting an
Notice: Array to string conversion
error.
$itemis an array, you either need to change how you are building$myArray, or you need to iterate once more (orimplodecleverly).