<?php $strs= ["discount of €50,20 on these items","This item on sale now for €30,20"]; foreach ($strs as $s){ if (preg_match('~(?<!\bfor\s)€(\d+(?:,\d+)?)~', $s, $m)) { echo $m[1].PHP_EOL; } else { echo "No match!"; } }
You have javascript disabled. You will not be able to edit any code.