- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$test1 = '07511 111111';
$test2 = '+447511 111111';
$test3 = '+44 (0) 7511 111111';
//step 1 - reduce it to digits:
preg_match_all('(?![\+][0-9+])', $test1, $digits);
var_dump($digits);