Respuesta :

The code
$names = array('joelmurach', 'rayharris', 'mikemurach');
$names= implode("\n", $names);
file_put-contents('usernames.txt', $names);

saves the data as a string with data items separated by new line characters