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
dvprog_19 [2020-04-02 14:11]
Daniel Viström
dvprog_19 [2024-04-12 13:45]
Daniel Viström
Line 51: Line 51:
 include 'foot.php'; include 'foot.php';
 </code> </code>
- 
  
  
Line 57: Line 56:
 <php> <php>
 /* /*
-Tutorial:\\ +<code php> 
-[[http://www.youtube.com/watch?v=QIkDnUoeS70|While]]\\+<?php 
 + 
 +function my_bubblesort(&$a){ 
 +    $i = 0; 
 +    while ($i < count($a) - 1){ 
 + 
 +        $j = 0; 
 +        while (            ){ 
 +            if (            ){ 
 +                
 +                
 +            } 
 +            $j++; 
 +        } 
 +        $i++; 
 +    } 
 +
 +</code> 
 + 
 +\\ 
 +**Huvudprogrammet** 
 +<code php> 
 +<?php 
 +include 'bubblesort.php'; 
 +include 'head.php'; 
 + 
 +$arr [5,9,4,7,2,12,7,12,15]
 +my_bubblesort($arr); 
 +$i = 0; 
 +while($i < count($arr)){ 
 +    echo $arr[$i. ' '; 
 +    $i++; 
 +
 +echo '<br>'; 
 + 
 +include 'foot.php'; 
 +</code> 
 */ */
 </php> </php>
 +