Arrays in php
Arrays are the group of rows, columns or both row and columns.
Arrays are of primarily two types :
1) One Dimensional Arrays
2) Two Dimensional Arrays
1) One Dimensional Arrays : Arrays which consist of only 1 dimensional are called 1-D arrays.
<html> <head> <title>PHP Basics</title> </head> <body> <?php $team = array('member 1', 'member 2', 'member 3', 'member 4', 'member 5'); echo "member at 3 is " .$team[3]; ?> </body> </html>
2) Two-dimensional arrays : Arrays which consists of rows and columns are referred to as two-dimensional arrays
<html> <head> <title>PHP Basics</title> </head> <body> <?php $twoDArray = array(array('a', 'b', 'c'), array('a', 'b', 'c','d'), array('e', 'f', 'g') ); // $twoDArray[row][column] echo $twoDArray[0][2]; // will output c ?> </body> </html>