public static function FILTER_SANITIZE_TELEPHONE($value)
	{
		$value = preg_replace('/^[^0-9+]+/', '', $value);  		// remove all from beginning execept numbers and +
		$value = preg_replace('/^\+39/', '', $value);  			// remove +39 prefix		
		$value = preg_replace('/^0039/', '', $value);  			// remove 0039 prefix
		$value = preg_replace('/[\s\(\)]+/', '', $value);  		// remove all blanks and parenthesis
				
		// separate number from extensions (if any)
		if( preg_match('/([0-9]+)(.*)/', $value, $matches)){
			$value = $matches[1];
			$extension = preg_replace('/[^0-9]/', '', $matches[2]);;
			if($extension){
				$value .= " [$extension]";
			}			
		}					

		return $value?:null;		
	}
public static function FILTER_SANITIZE_TELEPHONE($value)
	{
		$value = preg_replace('/^[^0-9+]+/', '', $value);  		// remove all from beginning execept numbers and +
		$value = preg_replace('/^\+39/', '', $value);  			// remove +39 prefix		
		$value = preg_replace('/^0039/', '', $value);  			// remove 0039 prefix
		$value = preg_replace('/[\s\(\)]+/', '', $value);  		// remove all blanks and parenthesis
				
		// separate number from extensions (if any)
		if( preg_match('/([0-9]+)(.*)/', $value, $matches)){
			$value = $matches[1];
			$extension = preg_replace('/[^0-9]/', '', $matches[2]);;
			if($extension){
				$value .= " [$extension]";
			}			
		}					

		return $value?:null;		
	}
public static function FILTER_SANITIZE_TELEPHONE ( $ value ) { $ value = preg_replace ( '/^[^0-9+]+/' , '' , $ value ) ; // remove all from beginning execept numbers and + $ value = preg_replace ( '/^\+39/' , '' , $ value ) ; // remove +39 prefix		 $ value = preg_replace ( '/^0039/' , '' , $ value ) ; // remove 0039 prefix $ value = preg_replace ( '/[\s\(\)]+/' , '' , $ value ) ; // remove all blanks and parenthesis // separate number from extensions (if any) if ( preg_match ( '/([0-9]+)(.*)/' , $ value , $ matches ) ) { $ value = $ matches [ 1 ] ; $ extension = preg_replace ( '/[^0-9]/' , '' , $ matches [ 2 ] ) ; ; if ( $ extension ) { $ value .= " [$extension]" ; } } return $ value ? : null ; }
Normalize an italian telephone number
empty allowed
Normalize an italian telephone number empty allowed