Show sourcecode
The following files exists in this folder. Click to view.
ovn_klass1.php
ovn_klass2.php
ovn_klass3.php
ovn_klass4.php
ovn_klass5.php
ovn_klass6.php
ovn_klass7.php
ovn_klass1.php
35 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Klasser 1</title>
</head>
<body>
<?php
class Boll {
public $färg;
public $radie;
public function __construct($färg, $radie) {
$this->färg = $färg;
$this->radie = $radie;
}
function getFärg(){
echo $this->färg;
}
function getRadie(){
echo $this->radie;
}
}
$boll1 = new Boll("röd","5cm");
$boll1->getFärg();
$boll1->getRadie();
?>
</body>
</html>