The string operation has a variable: $ arr [0] 1. I want to determine the length of the variable, which contains several characters. how can I do this? 2. what should I do if I want to take two places on the left? I just got in touch with PHP. please teach me, $ n = strlen ($ arr [0]); $ m = substr ($ arr [0],);, intstrlen string operations
There is a variable: $ arr [0]
1. how can I determine the length of a string containing several characters?
2. what should I do if I want to take two places on the left?
------ Solution --------------------
Pay attention to whether the string contains wide characters.
------ Solution --------------------
The width is unicode.
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