Home > Backend Development > PHP Tutorial > PHP reads the file content into a string and removes newlines, blank lines, and spaces at the beginning and end of the line (Zjmainstay original)_PHP tutorial

PHP reads the file content into a string and removes newlines, blank lines, and spaces at the beginning and end of the line (Zjmainstay original)_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:16:58
Original
1210 people have browsed it

Copy code The code is as follows:

//Output:
aaaa,bbbb,cccc,dddd,eeee,ffff,gggg,hhhh,iiii,jjjj,kk kk,ll ll

//file.php content:
aaaa

cccc
dddd
eeee
ffff
gggg
hhhh
iiii
jjjj
kk kk
ll ll


//file.php replace space (x), Tab (T) effect
aaaa

TTTT
cccc
ddddT
xxxxxxxxxxxT
eeeexxxxxxxxxx
ffff
gggg
hhhhxxxxxxxx
xxxxxxxxiiii
xxxxxxxxjjjjxxxxxxx
kkxxxkkTT
xxxxllxxllTT
Txxxxxxxxxx
TTTxx

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325785.htmlTechArticleCopy the code as follows: ?php /* *Read the file content into a string, and remove newlines and lines at the same time Trailing space on first line. */ header("Content-type: text/html; charset=utf-8"); echo preg_re...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template