meta data for this page
  •  

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
courses:ct30a3201:jussi_huotari [2013/09/27 14:42]
g0398210
courses:ct30a3201:jussi_huotari [2013/09/27 14:46] (current)
g0398210
Line 605: Line 605:
         // print the number of elements in your array to the screen         // print the number of elements in your array to the screen
               $fav_bands = array();               $fav_bands = array();
- ​  ​      array_push($fav_bands,​ "​Maroon 5"); +              ​array_push($fav_bands,​ "​Maroon 5"); 
-         array_push($fav_bands,​ "Bruno Mars"​);​ +              array_push($fav_bands,​ "Bruno Mars"​);​ 
-         array_push($fav_bands,​ "​Nickelback"​);​ +              array_push($fav_bands,​ "​Nickelback"​);​ 
-         array_push($fav_bands,​ "Katy Perry"​);​ +              array_push($fav_bands,​ "Katy Perry"​);​ 
-         array_push($fav_bands,​ "​Macklemore"​);​ +              array_push($fav_bands,​ "​Macklemore"​);​ 
-         print count($fav_bands);​ // prints 5+              print count($fav_bands);​ // prints 5
  
  
 elementtien poisto taulukosta: elementtien poisto taulukosta:
-  + 
-         ​<?php +        <?php 
-                 ​$array = array("​red",​ "​blue",​ "​green"​);​ +                $array = array("​red",​ "​blue",​ "​green"​);​ 
-                 ​unset($array[2]);​+                unset($array[2]);​
         ?>         ?>