// Example 1$text = "012345";if (ereg('[^0-9]', $text))
{ echo "This contains characters other than just numbers";}
else {
echo "This contains only numbers"; }
// Example 2$text = "mixedcharacters012345&../@";
if (ereg('[^A-Za-z0-9]', $text)) {
echo "This contains characters other than just numbers";}
else { echo "This contains only numbers"; }
?>