When I try to convert a number as a string to an integer, The value changes to 0.
I did a preg_match and picked out a number value which as an output of preg_match is in a string datatype.
That is, When i tried to extract the number 7123 in the following xml data,
<Count> 7123 </Count>
using preg_match, I got the value 7123 as a string. [Used gettype function]. When I am checking if its 0 or anyother value, I need to convert it to integer datatype just to compare the values farely. So i do intval("7123") or intval($count) to get the integer value. But when I echo the value, its 0. Read few blogs online and one said this type of a thing happens when the string value is non-printable. Can someone help me understand this and help me solve it?