I can use intval , but as per the documentation:
Lines are likely to return 0, although this depends on the leftmost characters of the line. General casting rules apply.
... and the value for parsing can be 0 , that is, I can not distinguish zero from a string .
$value1 = '0'; $value2 = '15'; $value3 = 'foo';
The real question is: how can I parse a string and distinguish between a string that is different from 0 and zero itself?
gremo source share