View sourcecode

The following files exists in this folder. Click to view.

functions.php

37 lines UTF-8 Unix (LF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
        
function omkretsräknare($r){
                    
$omkrets=3.14*$r*2;
                    return 
$omkrets;
                }

        function 
arearäknare($r){
            
$area=3.14*$r**2;
            return 
$area;
        }

        function 
mb_strrev($str){
            
$r '';
            for (
$i mb_strlen($str); $i>=0$i--) {
                
$r .= mb_substr($str$i1);
            }
            return 
$r;
        }

        function 
numuppgift($num){
            echo 
"<h2 class=\" blue center-align\" style=\"text-align: center; background-color:Cornflowerblue; padding:0.5rem;\">Uppgift {$num}:</h2>";
        }

        function 
övn(){
            echo 
"<h3 class=\"blue center-align\" style=\"text-align: center; background-color:Cornflowerblue; padding:0.5rem;\">övning:</h3>";
        }

        function 
namnskrivare($a,$b$c){
            echo 
"<p>Jag heter {$a} {$b} och jag går i klass {$c}</p>";
        }

        function 
cirkelränare($r){
            
$omkrets=3.14*$r*2;
            
$area=3.14*$r**2;
            echo 
"<p>Cirkeln har omkretsen {$omkrets}cm och arean   {$area}cm2</p>";
        }
?>