Home > Backend Development > PHP Tutorial > PHP implements splitting textarea values ​​into arrays based on carriage return and line feed_PHP tutorial

PHP implements splitting textarea values ​​into arrays based on carriage return and line feed_PHP tutorial

WBOY
Release: 2016-07-13 09:51:21
Original
1105 people have browsed it

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
http: //www.bkjia.com/PHPjc/1014279.html
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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template