// Function name: CheckTelephone($C_telephone)
// Function: Determine whether it is a legal phone number
// Parameter: $C_telephone (the phone number to be detected)
// Return value: Boolean value
//Remarks: None
//---------------------------------------- ---------------------------------------------
-- -----
function CheckTelephone($C_telephone)
{
if (!ereg("^[+]?[0-9]+([xX-][0-9]+) *$", $C_telephone)) return false;
return true;
}
//------------------------ -------------------------------------------------- ----------
-------
//-------------------- -------------------------------------------------- -------------
-------
// Function name: CheckValueBetween($N_var, $N_val1, $N_val2)
// Function: Judgment Whether it is a legal value within a certain range
// Parameters: $N_var The value to be detected
// $N_var1 The upper limit of the value to be detected
// $N_var2 The lower limit of the value to be detected
/ / Return value: Boolean value
// Remarks: None
//---------------------------------- -------------------------------------------------- --
-------
function CheckValueBetween($N_var, $N_val1, $N_val2)
{
if ($N_var < $N_var1 ││ $N_var > $N_var2 )
{
return false;
}
return true;
}
//----------------- -------------------------------------------------- ----------------
-------
//------------- -------------------------------------------------- --------------------
-------
// Function name: CheckPost($C_post)
// Function: Determine whether it is a legal postal code (fixed length)
// Parameter: $C_post (postal code to be checked)
// Return value: Boolean value
// Remarks: None
//-- -------------------------------------------------- -------------------------------
-------
function CheckPost($C_post)
{
$C_post=trim($C_post);
if (strlen($C_post) == 6)
{
if(!ereg("^[+]?[_0 -9]*$",$C_post))
{
return true;;
}else
{
return false;
}
}else
{
return false;;
}
}
//----------------------------- -------------------------------------------------- ---
-------
//-------------------------- -------------------------------------------------- -------
-------