PHP universal detection function set. ※Checkmoney ($ C_Money) checks whether the data is in the 99999.99 format. ※checkemailaddr ($ C_mailaddr) determines whether it is a valid email address. ※checkwebaddr ($ C_weburl) determine whether the data is valid // ※checkmoney ($ C_Money) checks whether the data is in the 99999.99 format
// ※Checkemailaddr ($ C_mailaddr) determines whether it is a valid email address.
// ※Checkwebaddr ($ C_weburl) determines whether the website is valid.
// ※Checkempty ($ C_char) determines whether the string is null.
// ※Checklengthbetween ($ C_char, $ I _len1, $ I _len2 = 100) determines whether it is a string within the specified length.
// ※Checkuser ($ C_user) determines whether the user name is valid.
// ※Checkpassword ($ C_passwd) determines whether the password is valid.
// ※Checktelephone ($ C_telephone) determines whether it is a legal phone number.
// ※Checkvaluebetween ($ N_var, $ N_val1, $ N_val2) determines whether it is a valid value in a certain range.
// ※Checkpost ($ C_post) determines whether it is a valid ZIP code (fixed length)
// ※Checkextendname ($ C_filename, $ A_extend) determines the extension of the uploaded file
// ※Checkimagesize ($ ImageFileName, $ LimitSize) indicates the size of the uploaded image.
// ※Alertexit ($ C_alert, $ I _goback = 0) indicates an invalid operation and exits.
// ※Alert ($ C_alert, $ I _goback = 0) indicates an invalid operation warning.
// ※Replacespacialchar ($ C_char) special character replacement function
// ※Exchangemoney ($ N_money) fund conversion function
// ※Windowlocation ($ C_url, $ C_get = "", $ C_getOther = "") function of window. location in PHP
//---------------------------------------------------------------
//-------------------------------------------------------------
// Function name: CheckMoney ($ C_Money)
// For usage: Check whether the data is in the 99999.99 format
// Parameter: $ C_Money (number to be detected)
// Return value: Boolean
// Standby Note: None
//------------------------------------------------------------
Function CheckMoney ($ C_Money)
{
If (! Ereg ("^ [0-9] [.] [0-9] $", $ C_Money) return false;
Return true;
}
//---------------------------------------------------------------
//--------------------------------------------------------
// Function name: CheckEmailAddr ($ C_mailaddr)
// For usage: determines whether the email address is a valid email address.
// Parameter: $ C_mailaddr (email address to be detected)
// Return value: Boolean
// Standby Note: None
//--------------------------------------------------------
Function CheckEmailAddr ($ C_mailaddr)
{
If (! Eregi ("^ [_ a-z0-9-] (. [_ a-z0-9-]) * @ [a-z0-9-] (. [a-z0-9-]) * $ ",
$ C_mailaddr ))
//(! Ereg ("^ [_ a-zA-Z0-9-] (. [_ a-zA-Z0-9-]) * @ [_ a-zA-Z0-9-] (. [_ a-zA-Z0-9-]) * $ ",
$ C_mailaddr ))
{
Return false;
}
Return true;
}
//----------------------------------------------------------------
Http://www.bkjia.com/PHPjc/445550.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445550.htmlTechArticle// ※checkmoney ($ C_Money) check whether the data is in 99999.99 format // ※checkemailaddr ($ C_mailaddr) determine whether it is a valid email address // ※checkwebaddr ($ C_weburl) determine whether it is valid...