PHP fgets read string and explode split string array by row
File.txt
Type | directory | file | size | creation time
file| C:\Program files\java\jre7\lib\zi\america\indiana| VEVAY|724|2014-10-13 09:36 file| C:\Program files\java\jre7\lib\zi\america\indiana| VINCENNES|884|2014-10-13 09:36file| C:\Program files\java\jre7\lib\zi\america\indiana| WINAMAC|932|2014-10-13 09:36 directory| C:\Program files\java\jre7\lib\zi\america| INDIANA|0|2014-10-13 09:36
readfile.php
"; $str = Explode (" | ", $line);//print_r ($STR); $file _type = $str [0]; $dir _name = $str [1]; $file _name = $str [ 2]; $file _size = $str [3]; $create _time = $str [4];echo $file _type;echo "
"Echo $dir _name;echo"
"Echo $file _name;echo"
"Echo $file _size;echo"
"Echo $create _time;echo"
";} Fclose ($f);? >
Results show
http://www.bkjia.com/PHPjc/953329.html www.bkjia.com true http://www.bkjia.com/PHPjc/953329.html techarticle PHP fgets read string and explode split string by line array file.txt Type | directory | file | size | Create Time file| C:\Program files\java\jre7\lib\zi\america\indiana| Veva ...