hello i use fread like this to get an integer from an url:
$f = fopen("http://sometextfilecontaininganinteger.txt", "r");
$incoming = fread($f, 16);
fclose($f);
if ($incoming)
{
the if check is there to see if the http call was successful.
unfortunately this fails also when the textfile contains the string ‘0’.
how could i work around this?
Instead of
you have to use
Because ‘0’ equals to FALSE when not comparing the type.