'账号', 1 => '账户名称', 2 => '交易时间', 3 => '借方发生额(支取)', 4 => '贷方发生额(收入)', 5 => '余额', 6 => '币种', 7 => '对方户名', 8 => '对方账号', 9 => '对方开户机构', 10 => '记账日期', 11 => '摘要', 12 => '备注', 13 => '账户明细编号-交易流水号', 14 => '企业流水号', 15 => '凭证种类', 16 => '凭证号', 17 => '个性化信息名称1', 18 => '个性化信息名称2', 19 => '个性化信息名称3', 20 => '个性化信息名称4', 21 => '个性化信息名称5', 22 => '个性化信息名称6', 23 => '个性化信息名称7', 24 => '个性化信息名称8', 25 => '个性化信息名称9', 26 => '个性化信息名称10', 27 => '个性化信息1', 28 => '个性化信息2', 29 => '个性化信息3', 30 => '个性化信息4', 31 => '个性化信息5', 32 => '个性化信息6', 33 => '个性化信息7', 34 => '个性化信息8', 35 => '个性化信息9', 36 => '个性化信息10', 37 => '交易介质编号' ]; public function __construct() { $this->clear(); } public function clear() { } public function match($line) : bool { if(count(self::$format) != count($line)) { return false; } $diff = array_diff(self::$format,$line); return empty($diff); } public function convert($line) : array { $self_no = trim($line[0]); if($self_no == '11050160990000000237' || $self_no == '11001079900053013913') { $self_bank = '中国建设银行股份有限公司北京傲城支行'; } $self_name = trim($line[1]); $trade_time = strtotime($line[2]); if($trade_time == false) { return []; } $out = mb_str_replace(',','',$line[3]); $in = mb_str_replace(',','',$line[4]); $left = mb_str_replace(',','',$line[5]); $money_type = $line[6]; $other_name = $line[7]; $other_no = $line[8]; $other_bank = $line[9]; $post_date = $line[10]; $subject = $line[11]; $remark = $line[12]; $trade_no = $line[13]; $proof_type = $line[15]; $proof_no = $line[16]; $result = [ 'trade_time' => $trade_time, 'out_amount' => $out, 'in_amount' => $in, 'left_amount' => $left, 'money_type' => $money_type, 'other_name' => $other_name, 'other_no' => $other_no, 'other_bank' => $other_bank, 'post_date' => $post_date, 'rsubject' => $subject, 'remark' => $remark, 'trade_no' => $trade_no, 'proof_type' => $proof_type, 'proof_no' => $proof_no, 'self_name' => $self_name, 'self_no' => $self_no, 'self_bank' => $self_bank, 'service_charge' => 0.0 ]; return $result; } }