PHP implements splitting the value of textarea into an array based on carriage return and line feed, textarea carriage return and line feed_PHP tutorial

WBOY
Release: 2016-07-13 09:51:14
Original
986 people have browsed it

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...
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