// Function name: AlertExit ($ C_alert, $ I _goback = 0)
// Usage: Illegal operation warning
// Parameter: $ C_alert (error message)
// $ I _goback (return to that page)
// Return value: String
// Standby Note: None
// Configure //-----------------------------------------------------------------------------------
-------
Function AlertExit ($ C_alert, $ I _goback = 0)
{
If ($ I _goback <> 0)
{
Echo "<script> alert ($ C_alert); history. go ($ I _goback); </script> ";
Exit;
}
Else
{
Echo "<script> alert ($ C_alert); </script> ";
Exit;
}
}
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
-------
// Function name: ReplaceSpacialChar ($ C_char)
// For usage: Special Character replacement function
// Parameter: $ C_char (string to be replaced)
// Return value: String
// Standby Note: None
// Configure //-----------------------------------------------------------------------------------
-------
Function ReplaceSpecialChar ($ C_char)
{
$ C_char = HTMLSpecialChars ($ C_char); // convert special characters into HTML format.
$ C_char = nl2br ($ C_char); // Replace the carriage return with <br>
$ C_char = str_replace ("", "", $ C_char); // replace spaces
$ C_char = str_replace ("<? "," <? ", $ C_char); // Replace the PHP tag
Return $ C_char;
}
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
-------
// Function name: ExchangeMoney ($ N_money)
// For use: Capital Conversion Function
// Parameter: $ N_money (number of the amount to be converted)
// Return value: String
// Standby Note: This function example: $ char = ExchangeMoney (5645132.3155) =>
$ Char = ¥5,645,132.31
// Configure //-----------------------------------------------------------------------------------
-------
Function ExchangeMoney ($ N_money)
{
$ A_tmp = explode (".", $ N_money); // divide the number into two parts by the decimal point, and store the array $ A_tmp
$ I _len = strlen ($ A_tmp [0]); // measure the width of the digits before the decimal point.
If ($ I _len % 3 = 0)
{
$ I _step = $ I _len/3; // For example, the width of the previous digit mod 3 = 0, which can be divided into $ I _step
Part
} Else
{
$ Step = ($ len-$ len % 3)/3 + 1; // For example, the width of the previous digit mod 3! = 0, which can be divided into $ I _step
Part + 1
}
$ C_cur = "";
// Convert the amount before the decimal point
While ($ I _len <> 0)
{
$ I _step --;
If ($ I _step = 0)
{
$ C_cur. = substr ($ A_tmp [0], 0, $ I _len-($ I _step) * 3 );
} Else
{
$ C_cur. = substr ($ A_tmp [0], 0, $ I _len-($ I _step) * 3 ).",";
}
$ A_tmp [0] = substr ($ A_tmp [0], $ I _len-($ I _step) * 3 );
$ I _len = strlen ($ A_tmp [0]);
}
// Convert the amount after the decimal point
If ($ A_tmp [1] = "")
{
$ C_cur. = ". 00 ";
} Else
{
$ I _len = strlen ($ A_tmp [1]);
If ($ I _len <2)
{
$ C_cur. = ".". $ A_tmp [1]. "0 ";
} Else
{
$ C_cur. = ".". substr ($ A_tmp [1], 0, 2 );
}
}
// Add and transfer the RMB symbol
$ C_cur = "¥". $ C_cur;
Return $ C_cur;
}
// Configure //-----------------------------------------------------------------------------------
-------
// Configure //-----------------------------------------------------------------------------------
------
// Function name: WindowLocation ($ C_url, $ C_get = "", $ C_getOther = "")
// Usage: window. location function in PHP
// Parameter: $ C_url indicates the URL of the redirection window.
// $ C_get method parameters
// $ C_getOther other parameters of the GET Method
// Return value: String
// Standby Note: None
// Configure //-----------------------------------------------------------------------------------
-----
Function WindowLocation ($ C_url, $ C_get = "", $ C_getOther = "")
{
If ($ C_get = "" & $ C_getOther = "")
If ($ C_get = "" & $ C_getOther <> "") {$ C_target = "" window. location = $ C_url?
$ C_getOther = + this. value "";}
If ($ C_get <> "" & $ C_getOther = ") {$ C_target =" "window. location = $ C_url?
$ C_get "";}
If ($ C_get <> "" & $ C_getOther <> "") {$ C_target = "" window. location = $ C_url?
$ C_get & $ C_getOther = + this. value "";}
Return $ C_target;
}
// Configure //-----------------------------------------------------------------------------------
-----
?>