Basic slot machine game 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.

&lt;?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 &amp;&amp; $num2 == $num3) {
$status = '&lt;big&gt;You are a winner!&lt;/big&gt;';

$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!';
}

?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Slot Machine Game!&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;center&gt;&lt;big&gt;&lt;?php echo $result; ?&gt;&lt;/big&gt;&lt;/center&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;&lt;big&gt;&lt;?php echo $status; ?&gt;&lt;/big&gt;&lt;/center&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;&lt;big&gt;&lt;?php echo 'You have &lt;strong&gt;'.$current.'&lt;/strong&gt; points!'; ?&gt;&lt;/big&gt;&lt;/center&gt;

&lt;/body&gt;
&lt;/html&gt;
Looks good. Few initial things:


Indent inside control structures, so everything inside your if() statement would be prefixed by one tab. (You can use a fixed number of spaces, but that can cause problems if you share your code with people who use a different tab-spacing system).
It is a really good idea to split out your code into logic (or "controller") and template (or "view"). Your html would then go in a different file and be loaded by your PHP file - a good first step with this sort of thing is Smarty. From there you can progress to a proper PHP framework such as Symfony or Zend (but be aware the learning curve is steep).
Tags such as &lt;center&gt; and &lt;big&gt; tend to be discouraged - use CSS instead.
Keep your PHP statements in your view as small as possible. For example I'd rewrite your score thus:



&lt;div class="points"&gt;
    You have &lt;strong&gt;&lt;?php echo $current ?&gt;&lt;/strong&gt; points!
&lt;/center&gt;



You'll need to define a CSS class called 'points', of course.