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)
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
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.
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:
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
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
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
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
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.