What is the difference between heredoc and nowdoc syntax in PHP and how can they be used effectively in Bash scripting?

Heredoc and nowdoc syntax in PHP are used to define multiline strings. Heredoc syntax allows for variable interpolation, while nowdoc syntax treats everything within the quotes as a string literal. In Bash scripting, heredoc syntax can be used effectively to pass multiline commands or data to a command or function.

// Heredoc syntax example
$name = 'Alice';
$message = <<<EOT
Hello $name,
This is a multiline message.
EOT;

echo $message;