However, when English and Chinese characters are mixed, the following problems may occur:
If there is such a string$ Str = "this is a string ";To intercept the first 10 characters of the string, useIf (strlen ($ str)> 10) $ str = substr ($ str, 10 )
1. Function Name: fgets
Function: Read a string from the stream.
Usage: char * fgets (char * string, int N, file * stream );
Annotation of the parameter: * The first address of the string input data; n-1: the length of the data block read at a time.
PHP Form Sensitive character filter class, PHP form filter
This article describes the php form sensitive character filter class and its usage. Share to everyone for your reference. The specific analysis is as follows:
Copy CodeThe code is as
int strlen (String $string)int strlen (string $string) Gets the length of the string $string if the [byte] length of the given string succeeds, and returns 0 if $string is empty.PHP$str 1= "ABCdef";//Output 6 $str 2= "AB CD";//Output 7, note,
PHP form Sensitive character filter code/*** Form Generation Validation File*/$_form = new Formhtmlfind ();Class formhtmlfind{/*** Output Form function* $formKey Form Key* $infoArray An array of raw information when updating*/
Public Function
PHP Cryptographic decryption function sharing, one is discuz! authcode cryptographic function (with detailed decomposition), one is the Encrypt () function.Need to use PHP to encrypt specific information, that is, through the encryption algorithm to
This article describes the php form sensitive character filtering class and its usage. Share to everyone for your reference. The specific analysis is as follows:
Copy Code code as follows:
/**
* Form Generation Validation File
*/
One place in the project uses the need to encrypt the user ID and pass it to the next contact for the reverse solution. (Forgive me not to disclose too many-_-!), the first thought is a function in the kangsheng ucenter, later searched, in the
The principle is to convert the Chinese characters to hexadecimal and according to some rules of string combination, to achieve the encoding and decoding of characters, to ensure the integrity and compatibility of the URL data transmission process,
One, the Chinese character to decimal principle analysis
In GBK encoding, a Chinese character is composed of two characters, and the method to get the character string is as follows
Copy Code code as follows:
$string = "Don't be
Chinese character encoding Research series phase III, PHP function Chapter Master ord () and Chr () function application, in the previous period [PHP Basics of ASCII code comparison and character conversion] in the article to understand the ASCII
1, the interception of GB2312 characters used in the function
PHP code
Copy Code code as follows:
Intercepting Chinese strings
function Mysubstr ($str, $start, $len) {
$tmpstr = "";
$strlen = $start + $len;
for ($i = 0; $i if
File operation. 2007-03-24 00:55
@ Function Name: FputcharFunction prototype: int fputchar (int ch)Function: Writes a character to the current position of the standard output stream (that is, on the screen)function returns: Returns the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.