cs:php

# PHP

Small guide about certain aspect of the PHP programming language

## Data Structures

### Arrays

In PHP arrays are associative. Keys can be integer or string, while values can be of any type.

// Define an associative array with two entries
$array = array("key1"=>"value1", "key2"=>"value2",); // Cycle on array entry foreach ($array as $key =>$value){
echo $key." ".$value." ".$array[$key]."\n";
}

Output:

key1 value1 value1
key2 value2 value2

If you found any error, or if you want to partecipate to the editing of this wiki, please contact: wiki [at] altervista.org

You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: http://wiki.altervista.org/cs/php