$str="000%%&/.,-b00456c78d"; $str1 = preg_replace('/\D/', '', $str); $string = ltrim($str1, '0'); echo $string;