When a variable is within a double-quoted or heredoc-quoted string, the complex (curly brace) notation can be used to delineate where the variable name ends. For instance, if you had a variable named $a, the 2nd line would be problematic, but the 3rd line would clearly show the parser what variable is being used:
$a = "a ";
echo "This is $atest.";
echo "This is only {$a}test.";
It's also needed if you want to use an array element with a quoted index within a string:
$myArray['a'] = 'a';
echo "This is {$myArray['a']} test.";