Code Snippets Php

// Example 1$text = "onlytextcharacters";
if (ereg('[^A-Za-z]', $text))
{
echo "This contains characters other than just letters";
}
else
{ echo "This contains only letters";
}
// Example 2$text = "mixedcharacters012*&.@";
if (ereg('[^A-Za-z]', $text))
{ echo "This contains characters other than just letters";}
else { echo "This contains only letters"; }
?>