Hier is een php script een class en een index bestand. Het is een teller, maar hij echo nix in de browser.
Wil iemand mij helpen en vertellen waar de fout inzit?
alvast bedankt.
index:
<?php
require_once ("count_class.php");
$teller = new Teller();
$teller = setStand(100);
$teller->ophogen();
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<title></title>
</head>
<body>
<?php
echo "de stand is" . $teller->getStand();
?>
</body>
</html>
class:
<?php
class Teller{
public $stand=1;
public function ophogen(){
$this->stand++;
}
public function __construct($stand=0){
$this->stand=$stand;
}
public function getStand(){
return $this->stand;
}
public function setStand($nieuweStand){
$this->stand=$nieuweStand;
}
}
?>