- Output for 5.3.0 - 5.3.25, 5.4.0 - 5.4.15
- Parse error: syntax error, unexpected '<' in /in/5pYIt on line 2
Process exited with code 255.
<?php
<pre><?php
$str = 'NAME OF ITEM 123456789012
OTHER NAME 987654321098
NAME 567890123456';
preg_match_all( '/^(.*?)\s+(\d+)$/m', $str, $matches);
var_dump( $matches);
$items = array();
foreach( $matches[2] as $k => $upc) {
$items[$upc] = $matches[1][$k];
}
var_dump( $items);