Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///
- a|b|c|d|e|f|g|h|i\n
- a2|b2|c2|d2|e2|f2|g2|h2|i2\n
- ////
- foreach(file('data.dat') AS $row) {
- $datas[] = explode('|', $row);
- }
- print_r($datas);
- or
- $file="person.txt";
- foreach(file($file) AS $row) {
- $arr = explode('|', $row);
- $arr_num = count($arr);
- for ($j=0; $j < $arr_num; $j++) {
- echo "$arr[$j] ";
- }
- echo "<br>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement