I usually use the third method:
echo 'Numbers: ' . $a . ' !';
I use single quotes as much as possible because I think it looks a lot cleaner. When I need things like a new line in my line, I usually write it separately from the rest of the line. This also points to this βspecialβ line a little more:
echo 'Numbers: ' . $a . ' !' . "\n";
I also think that the presence of variables inside double-quoted strings ( "like $so" ) is unclear, and you will not have syntax highlighting in many editors.
source share