Copy codeThe Code is as follows:
<? Php
$ Array = array ("key1" => "Simon", 2 => "Elaine"); // create an array
Echo $ array ["key1"]; // output Simon
Echo $ array [2]; // output Eline
?>
Copy codeThe Code is as follows:
<? Php
$ Array = array ("key1" => arrays (0 => 1, 1 => 10, 2 => 100 ),
"Key2" => array (0 => 5, 1 => 25, 2 => 125 ));
Echo $ array ["key1"] [0]; // output 1
Echo $ array ["key1"] [1]; // output 10
Echo $ array ["key1"] [2]; // 100 output
Echo $ array ["key2"] [0]; // output 5
Echo $ array ["key2"] [1]; // output 25
Echo $ array ["key2"] [2]; // output 125
?>
Copy codeThe Code is as follows:
<? Php
$ Array = array ("key1" => array (0 => 1, 1 => 10, 2 => 100), // define an array
"Key2" => array (0 => 5, 1 => 25, 2 => 125 ));
Print_r ($ array); // output array
?>
Copy codeThe Code is as follows:
<? Php
$ Array = array ("a", "B", "c"); // defines an array
Print_r ($ array); // output array
?>
Copy codeThe Code is as follows:
<? Php
$ Array = array ("a", "B", "c"); // defines an array
$ Array [0] = "Simon"; // modify the array element
Print_r ($ array); // output array
?>