PHP implements the method of splitting textarea values into arrays based on carriage returns and line feeds
This article describes the example of PHP implementation of splitting textarea values into arrays based on carriage returns and line feeds. Share it with everyone for your reference. The specific analysis is as follows:
textarea carriage return and line change rn
1
2
|
$keyword_list = trim($_REQUEST['keywords']);
$keyword_arr = explode("rn", $keyword_list);
|
1
2
|
$keyword_list = trim($_REQUEST['keywords']);
$keyword_arr = explode("rn", $keyword_list);
|
At this place, you need to pay attention to removing the spaces before and after the textarea, otherwise there will be an extra
Or you can use explode
It’s just that you can’t use rn, you can only use double quotes, not single quotes
http://www.bkjia.com/PHPjc/1014279.htmlwww.bkjia.com
true
TechArticlePHP implements splitting the value of textarea into an array based on carriage returns and line feeds. This example describes the PHP implementation of splitting the value of textarea into arrays. Method of splitting into arrays based on carriage return and line feed. Share it with everyone for your reference...