tags:

views:

59

answers:

2

How to insert a newline while using error_log() in php

I tried to use <br> and \n but those didn't work.

+1  A: 

Use double quotes when putting the error message:

error_log("This is a two lined message. \nThis is line two.");

should work.

error_log('This is a one lined message. \nThis is the same line still.');

will not work: notice the single quotes.

Konerak
You haven't given the 2nd and 3rd parameter(the name of the error log file )
Satish
So? The other parameters are optional. Maybe you should specify what you want to achieve, because AFAICT you've just been given the solution to your problem.
wimvds
A: 

If any, check you header parameter passed to the function.

Babiker