anantamu.com


PHP Array


Multiple elements store into one Array.

Numeric array : It contains the numeric array, index should be numeric .

Associative array : It contains the string array, index should be string.

Multidimensional array : It contains one or more arrays.


Array

1. Numeric array

<?php 

$Variables = array("X", "Y", "Z");
echo "The elements are " . $Variables[0] . ", " . $Variables[1] . " and " . $Variables[2] . ".";

?>

Result:The elements are X, Y and Z


2.Associative arrays

-
<?php 

$Variables = array("A"=>"X", "B"=>Y, "C"=>"Z");
echo "The elements are " . $Variables['A'] . ", " . $Variables['B'] . " and " . $Variables['C'] . ".";

?>

Result:The elements are X, Y and Z


3.Multidimensional arrays

-
<?php 
$Variables = array (
  array("X","Y","Z"),
  array("A","B","C")
);
echo "The elements are " . $Variables['0']['0'] . ", " . $Variables['0']['1'] . " and " . $Variables['0']['2'] . ".";
echo "The elements are " . $Variables['1']['0'] . ", " . $Variables['1']['1'] . " and " . $Variables['1']['2'] . ".";


?>

Result:The elements are X, Y and Z. The elements are A, B and C



List of All 223 Banks



Bank IFSC CODE