Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个 php 脚本,该脚本将为 Textarea 帖子中的每一行循环一个进程。我想知道是否有人可以发布一个例子。
foreach(explode("\n", $text) as $line) { // do something }
请参阅手册页explode()
explode()
您可能必须使用 \r\n 而不是仅 \n 用于 textarea (我记得很长一段时间才弄清楚)