View Single Post
  #3  
Old 14-06-2008, 02:15 AM
BSIT07-01's Avatar
BSIT07-01 BSIT07-01 is offline
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default 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 Code:
<?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]."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$myarray[0][1]."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$myarray[0][2]."".$myarray[1][0]."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$myarray[1][1]."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$myarray[1][2]."".$myarray[2][0]."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$myarray[2][1]."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$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 !!!!

Attached Files
File Type: php Array[BZUPAGES.COM].php (914 Bytes, 504 views)
Reply With Quote