<?php
$testes = [
"000.000.000-00",
"00000000000",
"000",
"usuario@servidor.com"
];
foreach ($testes as $teste) {
if (preg_match("/^\d{3}\.?\d{3}\.?\d{3}-?\d{2}$/", $teste)) { echo "É CPF", PHP_EOL;
} else {
echo "É e-mail", PHP_EOL;
}
}
PD9waHAKCiR0ZXN0ZXMgPSBbCiAgICAiMDAwLjAwMC4wMDAtMDAiLAogICAgIjAwMDAwMDAwMDAwIiwKICAgICIwMDAiLAogICAgInVzdWFyaW9Ac2Vydmlkb3IuY29tIgpdOwoKZm9yZWFjaCAoJHRlc3RlcyBhcyAkdGVzdGUpIHsKICAgIGlmIChwcmVnX21hdGNoKCIvXlxkezN9XC4/XGR7M31cLj9cZHszfS0/XGR7Mn0kLyIsICR0ZXN0ZSkpIHsKICAgICAgICBlY2hvICLDiSBDUEYiLCBQSFBfRU9MOwogICAgfSBlbHNlIHsKICAgICAgICBlY2hvICLDiSBlLW1haWwiLCBQSFBfRU9MOwogICAgfQp9