User Tools

Site Tools

Return to Home page


This shows you the differences between two versions of the page.

Link to this comparison view

cs:php [2019/02/26 14:33] (current)
Line 1: Line 1:
 +====== 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//.
 +<code php>
 +// 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";​
 +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: 2019/02/26 14:33 (external edit)

Privacy Policy