A very basic question it is but I wanted expert advice that is why posting it here.
Here are two functions,
what is the difference between the two ? Are both of them equivalently efficient and includes best practices or Which one of them is better to use in programming.
function is_numeric($number)
{
if(!preg_match("/^[0-9]+$/",$number))
return false;
return true;
}
function is_numeric($number)
{
if(preg_match("/^[0-9]+$/",$number))
return true;
else
return false;
}