$pFile = (object) pathinfo('/path/to/file/(123).jpg');printf("Filename: %s", preg_replace('~[^\d]~i', '', $pFile->filename));