strip non-numeric characters php code example Example: php remove non numeric $res = preg_replace("/[^0-9]/", "", "Every 6 Months" );