When do I need to use " or ' in php?

When do I need to use " or ' in php? I try to do a calculation with php but i always get parse error. Here is the funktion

$a="$user["fivestar"]";
$b="$user["fourstar"]";
$c="$user["threestar"]";
$e="$user["twostar"]";
$f="$user["onestar"]";
$g="$user["best_answer"];

function zusammenrechnen($a, $b, $c, $d, $e, $f, $g) {
     $multiplikation = (($a*5)+($b*4)+($c*3)+($d*2)+($e*1)+($g*100));
  
      return $multiplikation;

No answers yet