title: Matching braces in php can be confusing
body: <p>Can someone tell me the best way to learn how to tell which are matching braces below, like for example the 3 braces after the first else statement. Being a beginner this is very confusing. I currently use TextWrangler and see that it doesn't have that highlighting matching braces option.  The code is taken from Head First PHP &amp; MySQL. I also have seen on so that the Gedit text editor has the option to highlight matching braces but can someone tell me some others. Thanks. </p>
  
  <pre><code>&lt;?php
    require_once('appvars.php');
    require_once('connectvars.php');
  
    if (isset($_POST['submit'])) {
      // Grab the score data from the POST
      $name = $_POST['name'];
      $score = $_POST['score'];
      $screenshot = $_FILES['screenshot']['name'];
      $screenshot_type = $_FILES['screenshot']['type'];
      $screenshot_size = $_FILES['screenshot']['size']; 
  
      if (!empty($name) &amp;&amp; !empty($score) &amp;&amp; !empty($screenshot)) {
        if ((($screenshot_type == 'image/gif') || ($screenshot_type == 'image/jpeg') || 
        ($screenshot_type == 'image/pjpeg') || ($screenshot_type == 'image/png'))
          &amp;&amp; ($screenshot_size &gt; 0) &amp;&amp; ($screenshot_size &lt;= GW_MAXFILESIZE)) {
          if ($_FILES['screenshot']['error'] == 0) {
            // Move the file to the target upload folder
            $target = GW_UPLOADPATH . $screenshot;
            if (move_uploaded_file($_FILES['screenshot']['tmp_name'], $target)) {
              // Connect to the database
              $dbc = mysqli_connect(localhost, root , root , guitarwars);
  
              // Write the data to the database
              $query = "INSERT INTO guitarwars VALUES (0, NOW(), '$name', '$score', 
              '$screenshot')";
              mysqli_query($dbc, $query);
  
              // Confirm success with the user
              echo '&lt;p&gt;Thanks for adding your new high score! It will be reviewed and 
              added to the high score list as soon as possible.&lt;/p&gt;';
              echo '&lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; ' . $name . '&lt;br /&gt;';
              echo '&lt;strong&gt;Score:&lt;/strong&gt; ' . $score . '&lt;br /&gt;';
              echo '&lt;img src="' . GW_UPLOADPATH . $screenshot . '" alt="Score image" 
              /&gt;&lt;/p&gt;';
              echo '&lt;p&gt;&lt;a href="index.php"&gt;&amp;lt;&amp;lt; Back to high scores&lt;/a&gt;&lt;/p&gt;';
  
              // Clear the score data to clear the form
              $name = "";
              $score = "";
              $screenshot = "";
  
              mysqli_close($dbc);
            }
            else {
              echo '&lt;p class="error"&gt;Sorry, there was a problem uploading your screen shot 
              image.&lt;/p&gt;';
            }
          }
        }
        else {
          echo '&lt;p class="error"&gt;The screen shot must be a GIF, JPEG, or PNG image file no 
          greater than ' . (GW_MAXFILESIZE / 1024) . ' KB in size.&lt;/p&gt;';
        }
  
        // Try to delete the temporary screen shot image file
        @unlink($_FILES['screenshot']['tmp_name']);
      }
      else {
        echo '&lt;p class="error"&gt;Please enter all of the information to add your 
        high score.&lt;/p&gt;';
      }
  
    }
  ?&gt;
  </code></pre>