title: PHP passing user input to a function with $_POST
body: <p>I'm trying to pass user input from HTML form to following function in PHP</p>
  
  <p>but it gives following error right at first line as soon as i put brackets [] at first line after $_POST.</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '[', expecting ')' in C:\xampp\htdocs\project1\SITE3.php on line 175</p>
  </blockquote>
  
  <p>My code is following:</p>
  
  <pre><code>function setrating($_POST["rate"]){
          if($_POST["rate"]=="PG"){
  
              echo"hi";
          }
  
          else{
              echo"A";
          }
      }
  </code></pre>