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