-
-
/* - *Read the file content into a string, while removing newlines and spaces at the beginning and end of the line.
- */
- header("Content-type: text/html; charset=utf-8");
- echo preg_replace('/((s)*(n)+(s)*)/i',',' ,file_get_contents('./file.php'));//End_php
//Output:
- //aaaa,bbbb,cccc,dddd,eeee,ffff,gggg,hhhh,iiii, jjjj,kk kk,ll ll
- ?>
-
Copy code
file.php content:
aaaa
cccc
dddd
eeee
ffff
ggg
hhhh
iiii
jjjj
kkkk
ll ll
//file.php replace space (x), Tab (T) effect
aaaa
TTTT
cccc
ddddT
xxxxxxxxxxxT
eeeexxxxxxxxxx
ffff
ggg
hhhhxxxxxxxxx
xxxxxxxxxiii
xxxxxxxxjjjjxxxxxxx
kkxxxkkTT
xxxxllxxllTT
Txxxxxxxxxx
TTTxx
|