Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
dvprog_07 [2015-01-23 15:24]
Daniel Viström
dvprog_07 [2015-12-16 09:58]
Daniel Viström
Line 16: Line 16:
 // Skriva ut ett värde på en speciell position // Skriva ut ett värde på en speciell position
 include('head.php'); include('head.php');
-echo '<pre>';     // För att se vita tecken i html. 
  
 $names = array ('Astrid', 'Birgitta', 'Cecilia'); $names = array ('Astrid', 'Birgitta', 'Cecilia');
Line 35: Line 34:
   $i++;   $i++;
 } }
- 
- 
-echo '<br /><br />'; 
-//$ages = array (34,23,45); 
-$ages = array (         // Kan byta till andra nycklar än siffror. 
-  'Astrid' => 34,        // Lättare att se om man delar upp på flera rader. 
-  'Birgitta' => 23, 
-  'Cecilia' => 45 
-); 
-print_r($ages); 
-echo $ages['Birgitta'] . '<br /><br />'; 
  
 $i=3; $i=3;
Line 61: Line 49:
 } }
 print_r($arr2); print_r($arr2);
 +
 +echo '<br /><br />';
 +//$ages = array (34,23,45);
 +$ages = array (         // Kan byta till andra nycklar än siffror.
 +  'Astrid' => 34,        // Lättare att se om man delar upp på flera rader.
 +  'Birgitta' => 23,
 +  'Cecilia' => 45
 +);
 +print_r($ages);
 +echo $ages['Birgitta'] . '<br /><br />';
  
 $arr3 = array (     // Kan innehålla flera olika saker. $arr3 = array (     // Kan innehålla flera olika saker.
Line 71: Line 69:
 echo $arr3['colors'][2];  // Först yttre nyckeln, sedan inre nyckeln. echo $arr3['colors'][2];  // Först yttre nyckeln, sedan inre nyckeln.
  
-echo '</pre>'; 
 include('foot.php'); include('foot.php');
 </code> </code>
 +
 +
 +<php>
 +/*
 +echo '<pre>';     // För att se vita tecken i html.
 +echo '</pre>';
 +*/
 +</php>
 +