Basic Concept of an Array
An array is a kind of data structure that can store fixed size of element, Most of time we can see two type of an array used in any basic program...- 1D Array.
- 2D Array.
For exam array name[10];
2D Array:- Two Dimensional Array can be capable to store the the data in two Row and also in Column.
For example array name[10][10];
Now look at the below example and try this two understand the how it works:-
1d array example:-
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>1D Array</title>
</head>
<body>
<?php
$data_1=array('name'=>'suraj kumar', 'dob'=> '20.10.1980', 'age'=> '30','salary'=>50000);
foreach($data_1 as $data)
echo $data."/";
?>
</body>
</html>
Comments