Montag, 2. Juni 2014

PHP Basics: Storing Creating and storing Arrays

Arrays are very powerful. You can use them to store a set of data, compare them and update them incrementally. Here is a short example how adding is one
//this file is about arrays

//empty array
$ar = array();
 
//add value "4" to first possible index
$ar[] = 4;
foreach ($ar as $b); {
 echo $b." 
"; } //add value "5" to second index $ar[2] = 5; foreach ($ar as $b); { echo $b; }

1 Kommentar: