Email validation compatible with PHP's filter_var($value, FILTER_VALIDATE_EMAIL)
npm install filter-validate-email
<script src="https://unpkg.com/filter-validate-email@latest/dist/filter-validate-email.min.js"></script>
It is strongly recommended that you replace latest
with a fixed version.
<?php
$value = '...';
$result = (bool)filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE);
import validateEmail from 'filter-validate-email'
const value = '...'
const result = validateEmail(value)
<?php
$value = '...';
$result = (bool)filter_var($value, FILTER_VALIDATE_EMAIL);
import validateEmail from 'filter-validate-email'
const value = '...'
const result = validateEmail(value, false)
- Pure HTML Version:
mpyw/FILTER_VALIDATE_EMAIL.html