PHP Mantenha apenas Digitts

preg_replace('/\D/', '', $c)
Matteoweb