this example shows the behavior of two dimension array.two dimension means in rows and columns like table.
i.e.
[0][0] [0][1] [0][2]
[1][0] [1][1] [1][2]
[2][0] [2][1] [2][2]
<?php
$relation = array
(
"families"=>array
(
"Mazhar",
"Tasawar",
"Yawar"
),
"Relatives"=>array
(
"Kamran"
),
"Friends"=>array
(
"Awais",
"Ramiz",
"Saad"
)
);
echo $ relation['families'][2] . " is a part of the family";
?>
i.e.
[0][0] [0][1] [0][2]
[1][0] [1][1] [1][2]
[2][0] [2][1] [2][2]
PHP Example of two dimension array:
<?php
$relation = array
(
"families"=>array
(
"Mazhar",
"Tasawar",
"Yawar"
),
"Relatives"=>array
(
"Kamran"
),
"Friends"=>array
(
"Awais",
"Ramiz",
"Saad"
)
);
echo $ relation['families'][2] . " is a part of the family";
?>
No comments:
Post a Comment