how are you? I have a question, I made a session, to contain an array and then use it whenever I want in several parts of my page. the question, is that wanting to bring the data of each array within this session, throws me errors ... with the varDump () there is no drama, the issue is that I must return that data one by one to a jscript. p>
function CargarEnCarro($id){
session_start();
$vuelta = "hola";
$producto[]=[$id, $vuelta];
$_SESSION['CarroCompra'][]= $producto;
//var_dump($_SESSION['CarroCompra']);
for ($i=0; $i <count($_SESSION['CarroCompra']) ; $i++) {
for ($j=0; $j < count($_SESSION['CarroCompra'][$i]) ; $j++) {
$valor=$_SESSION['CarroCompra'][$i][$j];
echo $valor;
}
}
}
The issue is that I want to test it by showing it in the console, and it gives me the following error, just in the echo line:
<br />
<b>Notice</b>: Array to string conversion in
........ on line <b>494</b><br />
Array<br />