hallo allermaal ik heb een voetbal spel maar hij geeft ineens deze error:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /.../.../.../.../.../.../voetbal2.php on line 90
hier is het script
alvast bedankt voor het helpe
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /.../.../.../.../.../.../voetbal2.php on line 90
hier is het script
PHP:
<?
class match {
function play() {
$team1['points'] = 2;
$team2['points'] = 2;
if($team1['points'] > $team2['points']) {
$team1['extra'] = 10;
$team2['extra'] = 0;
}
elseif($team2['points'] > $team1['points']) {
$team1['extra'] = 0;
$team2['extra'] = 10;
}
elseif($team1['points'] == $team2['points']){
$team1['extra'] = 5;
$team2['extra'] = 5;
$team1['speler1'] = 10;
$team1['speler2'] = 10;
$team1['speler3'] = 10;
$team1['speler4'] = 10;
$team1['speler5'] = 10;
$team1['speler6'] = 10;
$team1['speler7'] = 10;
$team1['speler8'] = 10;
$team1['speler9'] = 10;
$team1['speler10'] = 10;
$team1['speler11'] = 10;
$team1['som'] = $team1['speler1'] +
$team1['speler2'] +
$team1['speler3'] +
$team1['speler4'] +
$team1['speler5'] +
$team1['speler6'] +
$team1['speler7'] +
$team1['speler8'] +
$team1['speler9'] +
$team1['speler10'] +
$team1['speler11'];
$team2['speler1'] = 10;
$team2['speler2'] = 10;
$team2['speler3'] = 10;
$team2['speler4'] = 10;
$team2['speler5'] = 10;
$team2['speler6'] = 10;
$team2['speler7'] = 10;
$team2['speler8'] = 10;
$team2['speler9'] = 10;
$team2['speler10'] = 10;
$team2['speler11'] = 10;
$team2['som'] = $team2['speler1'] +
$team2['speler2'] +
$team2['speler3'] +
$team2['speler4'] +
$team2['speler5'] +
$team2['speler6'] +
$team2['speler7'] +
$team2['speler8'] +
$team2['speler9'] +
$team2['speler10'] +
$team2['speler11'];
$team1['total'] = $team1['points'] + $team1['extra'] + $team1['som'] * 50 / 300;
$team2['total'] = $team2['points'] + $team2['extra'] + $team2['som'] * 50 / 300;
$team1 = substr($team1['total'], 0, 1);
$team2 = substr($team2['total'], 0, 1);
echo "<br>";
echo $team1."<br>";
echo $team2."<br>";
echo "<br>";
if($team1 == $team2) {
echo "Gelijk spel.";
}
elseif($team1 > $team2) {
echo "Team 1 is de winnaar!";
}
elseif($team2 > $team1) {
echo "Team 2 is de winnaar!";
}
}
}
$match = new match();
echo $match->play();
?>
Laatst bewerkt: