I have a session variable that is called $_session["arrayImagenHecha"] = $arrayImagenHecha
. This variable contains an array with images, my problem is that when I want to do an echo to show the position 0 of the arrya I get an error. For example:
$arrayImagenHecha = completarImagen($array_nombres_imagenes_ordenados,$array_caracteristicas_completas_img);
shuffle($arrayImagenHecha);
$arrayImagenHecha=$_SESSION["arrayImagenHecha"];
echo "<h4 align='center'>Carta del Servidor</h4>";
echo "<table style='border:2px solid black' align='center'";
echo "<tr><td style='border:1px solid black'>
<div class='container_servidor'>
<div id = 'servCard'class='card' >
<div class='front'>
<img class='img' src='assets/reverso/cardBack.jpg'/>
</div>
<div class='back'>
$arrayImagenHecha[0];
</div>
</div>
</div>
</td></tr>";
echo "</table>";
This code generates a table with several divs and inside I show the position 0 of the array $arrayImagenHecha[0]
. I want to do the same but instead of putting $arrayImagenHecha[0]
I want to do this: $_session["arrayImagenHecha"][0]