- preg_match_all: documentation ( source)
- var_export: documentation ( source)
<?php
$string = 'And should have value of £7.2';
$match = [];
preg_match_all('/(?<=\s\W|^\W|\s|^)\d(?:[\.\,]\d+)?(?=\W\s|\W$|\s|$)/', $string, $match);
var_export($match);