I’m trying to email $msg = print_r($_POST, true);. When I receive the email the array doesn’t look nice. Instead of 5 lines it shows it on one line. What can I do?
Edit: I can see in the email source that the print_r message is 5 lines. But not on the user interface (Gmail).
You’re probably getting it as HTML, in which case you need to surround it with a proper HTML tag:
Where
<pre>is the preformatted text tag.An alternative to this is to use
nl2br()on the$msg, but it still won’t look quite right as you want a monospaced font, which<pre>already gives you.