<?php $strings = [ 'Sunscreen 25g (200 Quantity)', 'Lubricant 100ml (50 Quantity)', 'WD-40 100ml (75 Quantity)', ]; foreach ($strings as $string) { echo preg_replace('~[^(]+\((\d+).*~', '$1', $string) . "\n"; }
You have javascript disabled. You will not be able to edit any code.