User Tools

Site Tools

Return to Home page

Table of Contents


Small guide about certain aspect of the PHP programming language

Data Structures


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",
// Cycle on array entry
foreach ($array as $key => $value){
  echo $key." ".$value." ".$array[$key]."\n";


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: admin [at]

You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url:
/web/htdocs/ · Last modified: 2024/04/08 22:34 by

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki
Privacy Policy