www说
$string = '#ORGNR "123" 1#ACCOUNT 1010 "Kassa"#ACCOUNT 1050 "Bank"#IB -1 1010 1923.15#IB 1 1050 201.42';$result = explode(PHP_EOL, $string);foreach ($result as $k => $v) { $result[$k] = preg_split('/\s+/', trim($v));}echo '<pre>';print_r($result); 或者$string = '#ORGNR "123" 1#ACCOUNT 1010 "Kassa"#ACCOUNT 1050 "Bank"#IB -1 1010 1923.15#IB 1 1050 201.42';echo($string);$result = explode(PHP_EOL, $string);foreach ($result as $k => $v) { $result[$k] = explode(' ', trim(preg_replace('/\s+/', ' ', $v)));}echo '<pre>';print_r($result);结果[ [0] => 'Array', [ [0] => '#ORGNR', [1] => '"123"', [2] => '1', ] [1] => 'Array', [ [0] => '#ACCOUNT', [1] => '1010', [2] => '"Kassa"', ] [2] => 'Array', [ [0] => '#ACCOUNT', [1] => '1050', [2] => '"Bank"', ] [3] => 'Array', [ [0] => '#IB', [1] => '-1', [2] => '1010', [3] => '1923.15', ] [4] => 'Array', [ [0] => '#IB', [1] => '1', [2] => '1050', [3] => '201.42', ]]