Differences
This shows you the differences between two versions of the page.
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] (current) Daniel Viström |
||
---|---|---|---|
Line 51: | Line 51: | ||
include ' | include ' | ||
</ | </ | ||
- | |||
Line 57: | Line 56: | ||
<php> | <php> | ||
/* | /* | ||
- | Tutorial:\\ | + | <code php> |
- | [[http:// | + | <?php |
+ | |||
+ | function my_bubblesort(& | ||
+ | $i = 0; | ||
+ | while ($i < count($a) - 1){ | ||
+ | |||
+ | $j = 0; | ||
+ | while ( ){ | ||
+ | if ( ){ | ||
+ | |||
+ | |||
+ | } | ||
+ | $j++; | ||
+ | } | ||
+ | $i++; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | **Huvudprogrammet** | ||
+ | <code php> | ||
+ | <?php | ||
+ | include ' | ||
+ | include 'head.php'; | ||
+ | |||
+ | $arr = [5, | ||
+ | my_bubblesort($arr); | ||
+ | $i = 0; | ||
+ | while($i < count($arr)){ | ||
+ | echo $arr[$i] . ' '; | ||
+ | $i++; | ||
+ | } | ||
+ | echo '< | ||
+ | |||
+ | include ' | ||
+ | </ | ||
*/ | */ | ||
</ | </ | ||
+ | |||