Array bidimensional
Scris: Mie Oct 26, 2011
Cod: Selectaţi tot
<?php
session_start();
echo '<form method=post action=" ">
coloane:<input type=text name=coloane><br>
linii:<input type=text name=linii><br>
<input type=submit name=submit></form>';
if(isset($_POST['submit'])){
$matrice['coloana']=array();
$matrice['linie']=array();
$coloane=$_POST['coloane'];
$linii=$_POST['linii'];
for($i=0;$i<$linii;$i++)
{ for($j=0;$j<$coloane;$j++)
$matrice[$i][$j]=0;
}
echo $matrice['coloana']['linie'];
}
?>
multumesc