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