This article mainly introduces PHP's implementation of splitting textarea values to arrays based on carriage return line breaks, involving techniques related to form elements and explode's string splitting, for more information about how to use PHP to split textarea values into arrays based on carriage return. Share it with you for your reference. The specific analysis is as follows:
Textarea carriage return behavior \ r \ n
$ Keyword_list = trim ($ _ REQUEST ['keyword']); $ keyword_arr = explode ("\ r \ n", $ keyword_list );
Note that the spaces before and after textarea should be removed; otherwise, an additional
Or you can use explode.
Only \ n can be used only with double quotation marks.
The above is the PHP implementation that splits the textarea value into the array _ php tip content according to the carriage return line. For more information, please follow the PHP Chinese network (www.php1.cn )!