get content file and convert it to int php -


i'm counting table content , save value in file. when there insert table, file created , save new count number. want 2 value , compare it. strong result.

this code:

$crc1 = strtoupper(dechex(crc32(file_get_contents('lastinsert.txt'))));  $crc2 = strtoupper(dechex(crc32(file_get_contents('newinsert.txt'))));   if($crc1>$crc2){ echo $diff=abs(intval($crc1)-intval($crc2)); } $querycount="select count(*) relations"; if (filesize('lastinsert.txt') == 0){ echo "the file empty"; } else if($crc1!=$crc2){                                   //if lastinsert different new 1 create newinsert file echo "the file isn't empty"; if($query_run= mysql_query($querycount)){     while($query_row = mysql_fetch_assoc($query_run)) { $res=print_r($query_row); file_put_contents("newinsert.txt",$query_row);  }  }  } if($query_run= mysql_query($querycount)){     while($query_row = mysql_fetch_row($query_run)) { $res=print_r($query_row); file_put_contents("lastinsert.txt",$query_row);  }  } 

what mean strong result?i guess meant string result.
will,for converting string int,just use this:

$string_result=(int) $int_result; 

of course there other ways,for example see this one.


Comments