I have been learning PHP and wanted to see if I could make a very simple slot machine game.  Everything works, but I'm sure this is not the best way to do this. Please let me know how you would do this and what I can do to improve.<?php$num1 = rand(1, 5);$num2 = rand(1, 5);$num3 = rand(1, 5);$result = $num1.' | '.$num2.' | '.$num3;// Read points from file$filename = 'points.txt';$handle = fopen($filename, 'r');$current = fread($handle, filesize($filename));fclose($handle);if ($num1 == $num2 && $num2 == $num3) {$status = '<big>You are a winner!</big>';$add_points = $current + 10;// Add points to file$handle = fopen($filename, 'w');$current_points = fwrite($handle, $add_points);fclose($handle);} else {$status = 'please try again!';}?><html><head><title>Slot Machine Game!</title></head><body><center><big><?php echo $result; ?></big></center><br /><br /><center><big><?php echo $status; ?></big></center><br /><br /><center><big><?php echo 'You have <strong>'.$current.'</strong> points!'; ?></big></center></body></html>
Basic slot machine game
php;beginner;game