PHP general detection function set (5)_PHP tutorial
// Function name: AlertExit($C_alert,$I_goback=0)
// Function: Illegal operation warning
// Parameter: $C_alert (error message prompted)
// $I_goback (return to That page)
// Return value: String
// Remarks: None
//----------------------- -------------------------------------------------- ----------
-------
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;
}
}
//--------- -------------------------------------------------- --------------------------
------
//----- -------------------------------------------------- ----------------------------
-------
// Function name: ReplaceSpacialChar($C_char )
// Function: Special character replacement function
// Parameter: $C_char (string to be replaced)
// Return value: String
// Remarks: None
/ /------------------------------------------------- ----------------------------------
-------
function ReplaceSpecialChar( $C_char)
{
$C_char=HTMLSpecialChars($C_char); //Convert special characters into HTML format.
$C_char=nl2br($C_char); //Replace carriage return with
$C_char=str_replace(" "," ",$C_char); //Replace spaces with
$C_char=str_replace(" ","< ?",$C_char); //Replace PHP tag
return $C_char;
}
//-------- -------------------------------------------------- --------------------------
-------
//---- -------------------------------------------------- --------------------------
-------
// Function name: ExchangeMoney($ N_money)
// Function: Fund conversion function
// Parameter: $N_money (amount to be converted)
// Return value: String
// Note: Example of this function: $ char=ExchangeMoney(5645132.3155) ==>
$char=¥5,645,132.31
//-------------------------- -------------------------------------------------- ------
-------
function ExchangeMoney($N_money)
{
$A_tmp=explode(".",$N_money ); //Press the number The decimal point is divided into two parts and stored in the array $A_tmp
$I_len=strlen($A_tmp[0]); //Measure the width of the digits in front of the decimal point
if($I_len%3== 0)
{
$I_step=$I_len/3; //If the width of the previous digits mod 3 = 0, it can be divided into $I_step
part
}else
{
$step=($len-$len%3)/3+1; //If the width of the previous digits mod 3 != 0, it 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]);
}
//After the decimal point Convert the amount
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 RMB symbol and transmit out
$C_cur="¥".$C_cur;
return $C_cur;
}
//----------------------------- -------------------------------------------------- -------------
------
//---------------- -------------------------------------------------- ------------------
------
// Function name: WindowLocation($C_url,$C_get="",$C_getOther="" )
// Function: window.location function in PHP
// Parameters: $C_url URL of the steering window
// $C_get GET method parameters
// $C_getOther Other parameters of the GET method
// Return value: String
// Remarks: None
//-------------------------- -------------------------------------------------- ------
-----
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;
}
//--------------------------------- --------------------------------------------------
-----
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

In 2025, global digital virtual currency trading platforms are fiercely competitive. This article authoritatively releases the top ten digital virtual currency trading platforms in the world in 2025 based on indicators such as transaction volume, security, and user experience. OKX ranks first with its strong technical strength and global operation strategy, and Binance follows closely with high liquidity and low fees. Platforms such as Gate.io, Coinbase, and Kraken are at the forefront with their respective advantages. The list covers trading platforms such as Huobi, KuCoin, Bitfinex, Crypto.com and Gemini, each with its own characteristics, but investment should be cautious. To choose a platform, you need to consider factors such as security, liquidity, fees, user experience, currency selection and regulatory compliance, and invest rationally

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Ranking of the top ten virtual currency trading platforms (latest in 2025): Binance: Global leader, high liquidity, and regulation has attracted attention. OKX: Large user base, supports multiple currencies, and provides leveraged trading. Gate.io: A senior exchange, with a variety of fiat currency payment methods, providing a variety of trading pairs and investment products. Bitget: Derivatives Exchange, high liquidity, low fees. Huobi: An old exchange that supports a variety of currencies and trading pairs. Coinbase: A well-known American exchange, strictly regulated. Phemex and so on.

Top 10 digital currency trading platforms: 1. OKX, 2. Binance, 3. Gate.io, 4. Huobi Global, 5. Kraken, 6. Coinbase, 7. KuCoin, 8. Bitfinex, 9. Crypto.com, 10. Gemini, these exchanges have their own characteristics, and users can choose the platform that suits them based on factors such as security, fees, currency selection, user interface and customer support.
