
14-06-2008, 02:15 AM
|
 | Addicted to Computer | |
Join Date: Sep 2007 Location: ------------ Age: 31
Posts: 1,309
Contact Number: --------------- Program / Discipline: BSIT Class Roll Number: 07-01 | |
Re: [PHP] Multidimensional Array
Here is the Code...
It's not being displayed Perfectly because site is taking this as HTML and is showing Line breaks where I have used < BR > tag . So download the attached file for original Coding
thanks |  | | | <?PHP
$myarray[0][0]=rand(0,100); $myarray[0][1]=rand(0,100); $myarray[0][2]=rand(0,100); $myarray[1][0]=rand(0,100); $myarray[1][1]=rand(0,100); $myarray[1][2]=rand(0,100); $myarray[2][0]=rand(0,100); $myarray[2][1]=rand(0,100); $myarray[2][2]=rand(0,100);
echo $myarray[0][0]." ".$myarray[0][1]." ".$myarray[0][2]."".$myarray[1][0]." ".$myarray[1][1]." ".$myarray[1][2]."".$myarray[2][0]." ".$myarray[2][1]." ".$myarray[2][2];
print "";
$sum=$myarray[0][0]+$myarray[1][1]+$myarray[2][2]; echo 'Sum of 1st 5th and 9th element is '.$sum;
?>
Kyun Ho gaya na !!!! | | |  | | | |