- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$pattern = '/^[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/';
preg_match('/^(.*<?)(.*)@(.*?)(>?)$/', 'philipptschiönder@dörler.co.at', $matches);
var_dump($matches);
$value = $matches[1] . idn_to_ascii($matches[2]) . '@' . idn_to_ascii($domain) . $matches[4];
$valid = preg_match($this->pattern, $value) || $this->allowName && preg_match($this->fullPattern, $value);
echo $valid;
?>