|
Answer» You can retrieve values out of ARRAYS using the array element expression $array[$key].
Here is a PHP example SCRIPT:
<?php $languages = array(); $languages["Zero"] = "PHP"; $languages["ONE"] = "Perl";
$languages["Two"] = "Java"; print("Array with inserted values:\N");
print_r($languages); ?>
This script will print:
Array with default KEYS:
The second value: Perl
Array with specified keys:
The third value: Java You can retrieve values out of arrays using the array element expression $array[$key].
Here is a PHP example script:
<?php $languages = array(); $languages["Zero"] = "PHP"; $languages["One"] = "Perl";
$languages["Two"] = "Java"; print("Array with inserted values:\n");
print_r($languages); ?>
This script will print:
Array with default keys:
The second value: Perl
Array with specified keys:
The third value: Java
|