<?php $a = [2, 5, 2, 3, 5]; foreach ($a as $v) { echo $v . "<br/>"; } $a[7]=9; $a['juan']='pablo'; foreach ($a as $clave=>$valor) { echo $clave." - ".$valor . "<br/>"; } for($i=0;$i<count($a);$i++){ echo $a[$i] . "<br/>"; } ?>
<?php $a = [2, 5, 2, 3, 5]; foreach ($a as $v) { echo $v . "<br/>"; } $a[7]=9; $a['juan']='pablo'; foreach ($a as $clave=>$valor) { echo $clave." - ".$valor . "<br/>"; } for($i=0;$i<count($a);$i++){ echo $a[$i] . "<br/>"; } ?>