CopyCode The 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 code The 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 code The 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 code The Code is as follows: <? PHP
$ Array = array ("A", "B", "C"); // defines an array
Print_r ($ array); // output Array
?>
Copy code The 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
?>