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_13 [2017-03-28 09:59]
Daniel Viström
dvprog_13 [2017-09-01 13:59]
Daniel Viström
Line 25: Line 25:
  
 include('head.php'); include('head.php');
-echo 'a4 = ' . a(4) . '<br />'; +echo 'a4 = ' . a(4) . '<br>'; 
-echo 'a5 = ' . a(5) . '<br />';+echo 'a5 = ' . a(5) . '<br>';
 include('foot.php'); include('foot.php');
  
Line 42: Line 42:
  */  */
 function namnutskrift($namn, $antal){ function namnutskrift($namn, $antal){
-  echo $namn . '<br />';+  echo $namn . $antal . '<br>';
   if ($antal == 1){  // Brytvillkor.   if ($antal == 1){  // Brytvillkor.
   } else {   } else {
Line 48: Line 48:
  // Funktionen anropar sig själv med ett nytt värde.  // Funktionen anropar sig själv med ett nytt värde.
  // Fortgår tills brytvillkoret nås.  // Fortgår tills brytvillkoret nås.
-  }  +  } 
 +  echo 'Hej' . $antal . '<br>';  // Skrivs ut när den "inre"-funktionen är färdigkörd.  
 } }
  
Line 62: Line 63:
 include('foot.php'); include('foot.php');
  
 +</code>
 +
 +
 +Utskrift från anropet namnutskrift('Daniel',5)
 +-------------------------------------
 +<code>
 +Daniel5
 +Daniel4
 +Daniel3
 +Daniel2
 +Daniel1
 +Hej1
 +Hej2
 +Hej3
 +Hej4
 +Hej5
 </code> </code>