PHP Notice: Array to string conversion Error -


this question has answer here:

<?php   $arr00 = array(1,5,7); $arr01 = array(9,6,3,$arr00); $arr02 = array(4,8,12,$arr01);  echo $length = count($arr00); echo "<br />";  echo $length1 = count($arr01); echo "<br />";  echo $length2 = count($arr02); echo "<br />"; for($i = 0; $i < $length; $i++)     for($j = 0; $j < $i; $j++)       for($k = 0; $k < $j; $k++){           echo "<pre>";     print_r($arr02);     echo "</pre>";        }    foreach ($arr00 $value)     {         echo $value." ";     }     foreach ($arr01 $value1)          {         echo $value1." ";     }     foreach ($arr02 $value2)      {         echo $value2." ";     } 

notice: array string conversion in c:\xampp\htdocs\mywebpage\3dimns.php on line 34 array 4 8 12 notice: array string conversion in c:\xampp\htdocs\mywebpage\3dimns.php on line 39 array

your problem starts here:

$arr00 = array(1,5,7); $arr01 = array(9,6,3,$arr00); $arr02 = array(4,8,12,$arr01); 

the fourth element of both $arr01 , $arr02 array, when loop on these arrays , try echo out value, message 4th iteration of loop.

what want do?

if want combine both arrays, should example array_merge() (although depends on how want handle duplicates):

$arr00 = array(1,5,7); $arr01 = array_merge( array(9,6,3), $arr00 ); 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -