o-r*_*rod 2 php database parsing laravel
我是 PHP 和 Laravel 的新手,我需要打开文件并解析内容以将它们传递到数据库。文本文件具有固定的列宽。它没有分隔符或标题。我认为使用子字符串并将每个子字符串分配给变量将是正确的方法,但我仍在学习该语言的过程中,我不知道如何实现这一点。
以下是文本文件中的数据示例:
1618 0002 9 1261 4141191269 4141191269 4 002 0
1606 0000 9 1159 4169191388 4169191388 4 012 0
1607 0009 7 9 505 04129284134 1245 1245 56984 4
1619 0000 9 6 1172 2129922686 2129922686 4 013 0
1606 0000 9 1159 4169191388 4169191388 4 012 0
1607 0009 7 9 505 04129284134 1245 1245 56984 4
1619 0000 7 6 521 1188# 1172 1172 0 001 4
1606 0000 9 1159 4169191388 4169191388 4 012 0
1607 0009 7 9 505 04129284134 1245 1245 56984 4
1619 0000 9 6 1252 2129922686 2129922686 4 003 0
1606 0000 9 1159 4169191388 4169191388 4 012 0
1607 0009 7 9 505 04129284134 1245 1245 56984 4
1619 0000 7 6 521 1188# 1252 1252 1 002 4
Run Code Online (Sandbox Code Playgroud)
列名称:
id
time
duration
cond_code
code_dial
code_used
dialed_num
calling_num
clg_num_in_tac
auth_code
frl
ixc_code
in_crt_id
out_crt_id
Run Code Online (Sandbox Code Playgroud)