Php string strrev function. Strrev defines and uses the strrev () function to convert a string. Next let's take a look at its syntax strrev (string) parameter description string: required. The specified string, which is defined and used in strrev.
Three reverse sorting methods except strrev () are interpreted. The PHP function strrev () test code is as follows: header (Content-type: texthtml; charsetutf-8); $ strimplode (, range (9,0 )); prin we are using
For the reverse sorting of strings,
The string inversion function strrev is not a standard library function in C language. Many C language compilers do not provide support for it. For example, if you enter the shell command MAN 3 strlen in Linux, the screen will display,
STRLEN(3)
PHP uses strrev to flip Chinese garbled characters,
This example describes how to solve the Chinese garbled characters flipped by strrev in PHP. We will share this with you for your reference. The details are as follows:
Garbled characters may occur
The usage of strrev () function is a very interesting function. The main function is to reverse the character string at the beginning and end and return the result after the inversion, I only write WEB development notes because of my limited energy.
In this paper, we explain how PHP uses Strrev to reverse the problem of Chinese garbled. Share to everyone for your reference, as follows:
When you flip Chinese with strrve in PHP, garbled behavior occurs.
For example:
Header
Hehe, fun, a really want to do a function encyclopedia network, just because my energy is limited, only write web development notes, a day an article update is already busy enough, because, my career is not only to write this blog, there are many
We are using
For the reverse order of strings, the PHP function Strrev () has the following test code:
header (' content-type:text/html; CharSet = UTF -8 ');
$ Str = implode (', Range (9, 0));
print ' p>strong>before reversed:
When you flip Chinese with strrve in PHP, garbled behavior occurs.
For example:
Header ("content-type:text/html; Charset=utf-8 "), Echo strrev (" Handling garbled problems using the Strrev () function ")." ";
The result of the operation is:
鮗 copy
Strrev definition and usageTheStrrev() The function returns a string.Let's take a look at its syntax.Strrev (string)Parameter descriptionString: required. The specified string. Let's take a look at simple instances. Echo strrev ("www.111cn.net ");?>
This article mainly introduces the PHP string reverse sorting implementation method, and summarizes and analyzes the implementation techniques of strrev function, bipartite, cyclic, recursive, and other commonly used string reverse sorting
Header files: #include The Strrev () function resets the string to its prototype:Char *strrev (char *str);"Parameter description" STR is the string to reverse.Strrev () resets the string that Str refers to.Return value returns a pointer to the
The Strrev function in C + +There is a function strrev in C + +, which reverses the string implementation, but keep in mind that the Strrev function is valid only for character arrays and is not valid for string types.See the code below, where I've
Oh, fun, I really want to do a function encyclopedia, just because my energy is limited, only write web development notes, one day an article update has been busy enough, because, my career is not only write this blog, there are many other sites
I really want to create a function for Baike. I only write WEB Development notes because of my limited energy. I am busy updating an article a day, because, my career is not just about writing this blog, but there are many other websites that need
I really want to create a function for Baike. I only write Web Development notes one day because of my limited energy.
ArticleThe update is busy enough, because my job is not just about writing this blog, but there are many other websites that need
Substr (STR, start, length );
Example: substr ('php is very good language );
Output is ve;
If the length of Start> STR is returned ();
Substr ('php is very good language );
Substr ('php is very good language ',4);
Output as (blank)
SUBSTR (str,start,length);
Example: substr (' PHP tutorial is very good language ', 4,5);
The output is the is ve;
When the length of the START>STR, it is returned as ();
substr (' PHP is very good language ', 26,5);
substr (' PHP is very good
Substr (str, start, length );
Example: substr ('php tutorial is very good language );
Output is ve;
If the length of start> str is returned ();
Substr ('php is very good language );
Substr ('php is very good language ', 4 );
Output as
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.