时间:2021-07-01 10:21:17 帮助过:7人阅读
foreach($str as $key=>$row)
{
if(preg_match_all('/\b[Nn][Ss][Kk]-\w{5}/',$sn,$match)){
$str[$key]['darfon_pn']=substr_replace($match[0][0],$row['darfon_pn'],7,2);
}else{
$str[$key]['darfon_pn'] = '';
}
}
$sn = 'NSK-34582 NSK-UUS89 NSK-89234';Array
preg_match_all('/\b[Nn][Ss][Kk]-\w{5}/',$sn,$match);
print_r($match[0]);
$str = '________';
foreach($match[0] as $v) {
$str = substr_replace($v, $str,7,2);
echo $str,PHP_EOL;
}