Copy CodeThe code is as follows:
$array = Array ("Key1" = "Simon", 2 = "Elaine"); Creation of arrays
echo $array ["Key1"]; Output Simon
Echo $array [2]; Output Elaine
?>
Copy CodeThe code is as follows:
$array = Array ("key1" = = Array (0 = 1, 1 =, 2 = 100),
"Key2" = = Array (0 = 5, 1 =, 2 = 125));
echo $array ["Key1"][0]; Output 1
echo $array ["Key1"][1]; Output 10
echo $array ["Key1"][2]; Output 100
echo $array ["Key2"][0]; Output 5
echo $array ["Key2"][1]; Output 25
echo $array ["Key2"][2]; Output 125
?>
Copy CodeThe code is as follows:
$array = Array ("key1" = = Array (0 = 1, 1 =, 2 = 100),//define Array
"Key2" = = Array (0 = 5, 1 =, 2 = 125));
Print_r ($array); Output array
?>
Copy CodeThe code is as follows:
$array = Array ("A", "B", "C"); Defining arrays
Print_r ($array); Output array
?>
Copy CodeThe code is as follows:
$array = Array ("A", "B", "C"); Defining arrays
$array [0] = "Simon"; Modifying an array element
Print_r ($array); Output array
?>
http://www.bkjia.com/PHPjc/319944.html www.bkjia.com true http://www.bkjia.com/PHPjc/319944.html techarticle Copy the code as follows:? php $array = Array ("Key1" = "Simon", 2 = "Elaine");//array creation echo $array ["Key1"];//Output Simon echo $array [2]; Output Elaine? Copy code Generation ...