@
kkk414 改了一下,你再试试
<?php
header('Content-Type: text/html; charset=gb2312');
$d = dir(dirname(__FILE__));
while(false !== ($v = $d->read())) {
if(strpos($v,'TXT')){
set_time_limit(120);
$file_str = file_get_contents($v);
$file_lines = explode("\r\n",$file_str);
foreach($file_lines as $file_line){
preg_match('/[\s]{10,}([\d]{18}[ⅩxX]{0,1}).*[\s]{5,}00(.*)$/',$file_line,$file_parts);
if($file_parts[1] && $file_parts[2]){
file_put_contents($file_parts[1].'.jpg', base64_decode($file_parts[2]));
}
}
}
}
echo 'ok';