开发者

PHP Text area foreach line [closed]

开发者 https://www.devze.com 2023-01-06 22:53 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

开发者_如何学Go Improve this question

Im trying to code a php script that will loop a process for each line in a Textarea post. I was wondering if someone can post an example.


foreach(explode("\n", $text) as $line) {
    // do something
}

See the manual page on explode()


You might have to use \r\n instead of just \n for textarea (I remember figuring it out for quite a while)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号