String length problem vardump print a string
String (14) "00107042012"
How is the length of the obtained string 14?
It must be 11 numbers!
Why?
Reply to discussion (solution)
Your string contains the first three special characters (+ BOM)
Let's look at the two outputs.
The ascii code 239,187,191 of the three special characters is the ef bb bf of the BOM header.
';$str = '00107042012';$str1 = '00107042012';echo 'str:
';for($i=0,$len=strlen($str);$i<$len;$i++){ echo ord(substr($str,$i,1)).'
';}echo '
str1:
';for($i=0,$len=strlen($str1);$i<$len;$i++){ echo ord(substr($str1,$i,1)).'
';}?>
str:2391871914848494855485250484950str1:4848494855485250484950
You can remove it using a program.
Your string contains the first three special characters (+ BOM)
Let's look at the two outputs.
The ascii code 239,187,191 of the three special characters is the ef bb bf of the BOM header.
';$str = '00107042012';$str1 = '00107042012';echo 'str:
';for($i=0,$len=strlen($str);$i<$len;$i++){ echo ord(substr($str,$i,1)).'
';}echo '
str1:
';for($i=0,$len=strlen($str1);$i<$len;$i++){ echo ord(substr($str1,$i,1)).'
';}?>
str:2391871914848494855485250484950str1:4848494855485250484950
You can remove it using a program.
The problem has been solved. thanks to the moderator for replying ~ The next time you get it, convert it to an ascii code output.