February, 2015


Single and double quotes in PHP mail

I play with PHP contact forms a lot, but one thing to remember is that the PHP mail function is particular about strings being passed into it. Using double quotes has a different outcome versus using single quotes when using character escaped literals.

As a rule of thumb, use double quotes to retain escaped characters for quotation marks, line breaks, tabs, etc.

("/r/nNew line")
Share Button