Php universal detection function set (1 ). ※Checkmoney ($ C_Money): Check whether the data is in the 99999.99 format. ※checkemailaddr ($ C_mailaddr): Check whether the data is in a valid email address. ※checkwebaddr ($ C_weburl) determine whether it is a valid network // ※checkmoney ($ C_Money) check whether the data is in the 99999.99 format
// ※Checkemailaddr ($ C_mailaddr) determines whether the email address is valid.
// ※Checkwebaddr ($ C_weburl)
// ※Checkempty ($ C_char) determines whether the string is null.
// ※Checklengthbetween ($ C_char, $ I _len1, $ I _len2 = 100)
// ※Checkuser ($ C_user) determines whether the user name is valid.
// ※Checkpassword ($ C_passwd) determines whether the password is valid.
// ※Checktelephone ($ C_telephone)
// ※Checkvaluebetween ($ N_var, $ N_val1, $ N_val2) determines whether the value is valid within a certain range.
// ※Checkpost ($ C_post) determines whether the postal code is valid (fixed length)
// ※Checkextendname ($ C_filename, $ A_extend) indicates 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
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
-------
// 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
// Configure //-----------------------------------------------------------------------------------
-------
Function CheckMoney ($ C_Money)
{
If (! Ereg ("^ [0-9] [.] [0-9] $", $ C_Money) return false;
Return true;
}
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
-------
// Function name: CheckEmailAddr ($ C_mailaddr)
// 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
// Configure //-----------------------------------------------------------------------------------
-------
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;
}
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
-------
Http://www.bkjia.com/PHPjc/532632.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/532632.htmlTechArticle// ※checkmoney ($ C_Money) check whether the data is in 99999.99 format // ※checkemailaddr ($ C_mailaddr) check whether it is a valid email address // ※checkwebaddr ($ C_weburl) determine whether the network is valid...