PHP Text area foreach line [closed]
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 questionIm 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)
精彩评论