- preg_match: documentation ( source)
- var_export: documentation ( source)
<?php
$array = [
'Some Text',
'Some Other Text (+£14.20)',
'Foo',
'Text Text (+£26.88)',
'Another One (+£68.04)',
];
$result = [];
foreach ($array as $v) {
$result += preg_match("/(.+) \(\+£([^)]+)\)/", $v, $m) ? [$m[1] => (float) $m[2]] : [$v => 0];
}
var_export($result);