You need to understand that PHP interprets text inside single quotes literally, but expands what is inside double quotes; so you will get a different result if you do
substr_count($article->texte, "\n");
To answer your question, using nl2br is quickest, but if you really want to replace every occurrance of "\n" with "</p><p>" then do:
$content = str_replace("\n", '</p><p>', $content);