replaced \n with PHP_EOL to address cross platform compatibility