User Tools

Site Tools


cs:php
Site was transfered to www.skenz.it
Please, always refer to this link with the following URL: http://www.skenz.it/cs/php

Table of Contents

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://www.skenz.it/cs/php
/membri/wiki/data/pages/cs/php.txt · Last modified: 2015/10/28 15:22 (external edit)


Policy sui Cookie