This:
var_dump(nl2br("aaa\naaa", false));
Outputs:
NULL
I am using PHP Version 5.2.13. Doctype is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
What am I doing wrong?
This:
var_dump(nl2br("aaa\naaa", false));
Outputs:
NULL
I am using PHP Version 5.2.13. Doctype is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
What am I doing wrong?
Have a look at the changelog. The second parameter was added in PHP 5.3.0
The second false
parameter was added in PHP 5.3. Older versions of the function probably fail if passed an extra parameter they don't expect. Local experiments confirm this, the code runs fine on PHP 5.3 and fails on 5.2.10.