code: public function getLastFilePosition($filePath)
      {
          if (!file_exists($filePath)) {
              return 0;
          }
  
          $f = fopen($filePath, 'r');
          fseek($f, -1, SEEK_END);
          return ftell($f);
      }
docs: Returns current end position for specified file path
  
  @param string $filePath
  @return int