Detailed usage of strtr string replacement in PHP, strtr string. The strtr string replacement usage in PHP is described in detail. This document describes how to replace strtr strings in PHP. Share it with you for your reference. The detailed
STRTR string substitution usage in PHP, STRTR string
This example describes the use of STRTR string substitution in PHP. Share to everyone for your reference. The specific analysis is as follows:
STRTR (string,from,to) or STRTR (String,array)
First,
PHP string replacement function strtr. What we want to talk about today is about the two statuses strtr (string, from, to) of the php string replacement function strtr) or strtr (string, arr. what we want to talk about today isLet's take a look at
Strtr (string, from, to): Start to replace each character. Take the shorter character from and to as the standard. For example: strtr (aidenliu, ai, B) only Replace the output in the original string: bidenliustrtr (aidenliu, a, bc) only replace the
Turn: http://zhangdewen06452.blog.163.com/blog/static/1108031320109229103491/
Strtr (string, from, ):
Replace characters one by one. Take the shorter one from and to as the standard. For example:
Strtr ("aidenliu", "AI", "B") only replaces the
STRTR (string,from,to):
Replace one character at a distance, whichever is shorter in the From and to, for example:STRTR ("Aidenliu", "AI", "B") replaces only the a output that appears in the original string: BidenliuSTRTR ("Aidenliu", "a", "BC")
This article mainly introduces the use of strtr string replacement in PHP, explains in detail the usage and skills of strtr string replacement with a large number of examples, and compares it with str_replace to deepen understanding, for more
What we're going to talk to you about today is aboutLet's take a look at this php string substitution function php string substitution function strtr () two states
STRTR (String,from,to)
or STRTR (String,array)
First for PHP string substitution
Today, we will talk about the strtr () function used to replace PHP Strings. For beginners, The strtr () function of the PHP string replacement function is still relatively simple, and we hope that the content introduced in this article will give
This article describes the STRTR string substitution in PHP for a friend who needs to learn a detailed reference to this article.
STRTR (String,from,to)or STRTR (String,array)
First of all, for the STRTR function, the first wayLet's take a look at
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.