I think the best way to do it is to simply replace all your \n's with \n> <-- should be & gt; not the literal greater than symbol.
Of course, some people would have you believe that regex is the way to go, but for simple string replacement, use str_replace()
example
$string = str_replace("\n", "\n>",$string);
Make sure your nexlines are just \n and not \n\r.