explode textarea php (at new lines)

前端 未结 4 931
后悔当初
后悔当初 2020-12-08 01:04

can I do:

explode(\"\\n\", $_POST[\'thetextarea\']);

and have it work on all platforms? (The question I am asking is will it ever be \\r\\n

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 01:22

    You could also use the PHP_EOL constant:

    explode(PHP_EOL, $_POST['thetextarea']);
    

提交回复
热议问题