And so on, in short, will return incomplete, always missing the first few characters, do not know why??
------Solution--------------------
A second parameter:
1. If more than one character is included, use only "first character"
2. If it is not a string, it will be converted to an integer and treated as a character order value
Example: Echo strrchr ("Hello aaaaworld!", "Aaaaworld");
Find string only with a, output: aworld!
This is right.
------Solution--------------------
PHP Manual:
If needle contains more than one character, only the first is used
If needle contains more than one character, only the first character is used. This behavior differs from STRSTR ().
W3school:
Specifies the character to find. If the parameter is a number, the character that matches the ASCII value of the number is searched.
Obviously the latter ignores the description "use only the first character"
But the characters to look for and the string to find are different.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service