nl2br
is a glorified remake of str_replace("\n", "<br />", $text)
. If your string doesn't have ANY newline characters, there's nothing to replace and you've basically got an expensive print
/echo
occuring.
You also have PHP syntax errors. You cannot use quoted array keys in a double-quoted string:
echo "$array[key]"; // ok
echo "$array['key']"; // wrong
echo "{$array['key']}"; // ok - extended syntax.