Using multiple line variable inside a function?

Could be because you are using the concatenating assignment operator incorrectly:

$note_content. =

should be

$note_content .=

http://php.net/manual/en/language.operators.string.php