[Plain] Description Translate a string of text into a password. The password rules are as follows: The original lowercase letters are all translated into uppercase letters, and all uppercase letters are translated into lowercase letters. The
String truncation is a very common programming task, which is often used for string truncation with Chinese characters. Although it is not difficult, it takes time to write a function. here we will introduce a good string truncation function to meet
In the fourth part of the Chinese character encoding Study Series, PHP analyzes the conversion principle of Chinese characters, mainly discusses the methods for converting Chinese characters into decimal and hexadecimal formats, and master the
Although PHP has a ready to intercept string function substr (), but this function can not intercept the character string, to achieve this effect also requires us to write the corresponding function. Chinese characters have a variety of coding, such
Sometimes in the project we need to use PHP to encrypt specific information, that is, through the encryption algorithm to generate an encrypted string, the encrypted string can be decrypted by the decryption algorithm, so that the program to process
String interception is a very common programming task, and often a string interception with Chinese is often used. Although not difficult, but write their own function implementation and time-consuming, here is a more useful string interception
Definition and usage
The
strlenThe length string returned by the () function.
His function is to calculate the length of the word character, Chinese one word is 2Grammar
Strlen (String)
Parameter
Description
String
Topic:Writing functionsint Palindrom (char *string);If the argument string is a palindrome, the function returns True, otherwise it returns false. A palindrome is the same as a string that reads from left to right and is read from one to the left.
1. functions used to intercept gb2312 characters
PHP
Code
Copy code The Code is as follows: // Truncate a Chinese String
Function mysubstr ($ STR, $ start, $ Len ){
$ Tmpstr = "";
$ Strlen = $ start + $ Len;
For ($ I = 0; $ I If (ord (substr ($
String truncation is a very common programming task, which is often used for string truncation with Chinese characters. Although it is not difficult, it takes time to write a function. Here we will introduce a good string truncation function to meet
Php string truncation function. Php Tutorial string truncation function in php there is a string truncation function substr, but this function can only intercept English does not support Chinese and other mixed body, below we provide three function
Experts teach you how to use PHP string truncation functions. When learning PHP, you may encounter the PHP string truncation problem. here we will introduce the solution to the PHP string truncation function problem. here we will share it with you.
Extension functions are stored in the * Smartylibsplugins Directory. the file name format is modifier. xxxx. php, and the function name format is functionsmarty_modifier_xxxx.
Chinese: modifier.cn _ truncate. php
The code is as follows:
Function
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.