如何获取此标头中的边界?
$header = 'Content-Type: multipart/report; report-type=delivery-status;'."'n"
.' boundary="9B095B5ADSN=_01D16F24CC6015F600AB1926COL004?MC5F18.ho"';
preg_match('/Content-Type:(.*)boundary="([^'"]+)"/i', $header, $match);
print_r($match);
输出
9B095B5ADSN=_01D16F24CC6015F600AB1926COL004?MC5F18.ho
试试这个
preg_match('/boundary="(.*?)"/i', $header, $match);
或
preg_match('/Content-Type:(.*)'n*'s*boundary="([^'"]+)"/i', $header, $match);
输出
9B095B5ADSN=_01D16F24CC6015F600AB1926COL004?MC5F18.ho
preg_match('/boundary=(.*)/', $header, $match);