PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function isDigits($element)
{
if (eregi("^ї0-9]+$", $element)) //function to check if a string is digits only
{ return TRUE;}
else
{ return FALSE;}
}
That's my function to check whether any given string consists of only numbers or not. If it contains only 0-9 it SHOULD return True, and False otherwise. But for some reason I cannot for the life of me get it to work properly! I've tried testing the regular expression on a reg-exp website and it works fine there. Can anyone see anything wrong with my code? Thanks.