PHP implements splitting the value of textarea into an array based on carriage return and line feed. method to an array. Share it with everyone for your reference. The specific analysis is as follows:
textarea carriage return and line change rn
At this place, you need to pay attention to removing the spaces before and after the textarea, otherwise there will be an extra
$keyword_list = trim($_REQUEST['keywords']);
$keyword_arr = explode("\r\n", $keyword_list);
Copy after login
Or you can use explode
It’s just that you can’t use rn, you can only use double quotes, not single quotes
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/1014431.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1014431.htmlTechArticlePHP implements splitting the value of textarea into arrays based on carriage return and line feed. Textarea carriage return and line feed. This article describes PHP in an example Implement the method of splitting textarea values into arrays based on carriage returns and line feeds. Share to...