How to replace comma in string with newline and write the string to text file in PHP

1 Answer

0 votes
File_put_contents("d:\\data.txt", str_replace(",", PHP_EOL, $s));


/*
run: 

data.txt
--------
php
c
c++c#
javascript

*/

 



answered Jul 5, 2017 by avibootz
...