POSIX uses different character classes than PCRE. You would have to replace the \d by its corresponding POSIX class:
$myvar = 123;
if(!ereg("^[[:digit:]]*\\.?[[:digit:]]*$",$myvar))
echo "Amount Should be Numeric.";
else
echo "Amount is numeric";
Within a bracket expression, the name of a character class enclosed in
`[:' and `:]' stands for the list of all characters belonging to that
class. Standard character class names are:
alnum digit punct
alpha graph space
blank lower upper
cntrl print xdigit
These stand for the character classes defined in wctype(3). A locale
may provide others. A character class may not be used as an endpoint
of a range.
If you do this you will see what results they give you. Another one gives true and another false. That is why you get such a result. You can see both functions return values from php.net what they should be in what situation.
According to php.net that latter preg_match should return either the number of times pattern matches or false if error occured. So it seems that in your pattern there must be an error then right? I dont really know what that error would be now.
And preg_match uses perl compatible regular expressions which ereg does not. So maybe it has something to do with this?