开发者

PHP Text area foreach line [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜