|
Posted by acsandras on 12/06/05 12:23
I am trying to extract data from an iso-8859-1 encoded XML document. I
open the file, and read each line after each other, and extract some
values. These values are behaving oddly, though.
I can display them as strings:
echo $value; // Returns 0.4
echo "'$value'"; // Returns '0.4'
But I can not convert them into float:
echo floatval($value); // Returns 0
I did some debugging, which shows that the string length is 18, and not
3 as I axpected.
echo strlen($value); // Returns 18
The encoding is ASCII:
echo mb_detect_encoding($value); // Returns ASCII
Does anybody have an idea what this could be? I am using PHP 4.3.4.
Thanks in advance, best regards;
András
[Back to original message]
|