protected function hasBOM($filePointer, $encoding)
    {
        $hasBOM = false;

        $this->globalFunctionsHelper->rewind($filePointer);

        if (array_key_exists($encoding, $this->supportedEncodingsWithBom)) {
            $potentialBom = $this->supportedEncodingsWithBom[$encoding];
            $numBytesInBom = strlen($potentialBom);

            $hasBOM = ($this->globalFunctionsHelper->fgets($filePointer, $numBytesInBom + 1) === $potentialBom);
        }

        return $hasBOM;
    }
protected function hasBOM($filePointer, $encoding)
    {
        $hasBOM = false;

        $this->globalFunctionsHelper->rewind($filePointer);

        if (array_key_exists($encoding, $this->supportedEncodingsWithBom)) {
            $potentialBom = $this->supportedEncodingsWithBom[$encoding];
            $numBytesInBom = strlen($potentialBom);

            $hasBOM = ($this->globalFunctionsHelper->fgets($filePointer, $numBytesInBom + 1) === $potentialBom);
        }

        return $hasBOM;
    }
protected function hasBOM ( $ filePointer , $ encoding ) { $ hasBOM = false ; $ this -> globalFunctionsHelper -> rewind ( $ filePointer ) ; if ( array_key_exists ( $ encoding , $ this -> supportedEncodingsWithBom ) ) { $ potentialBom = $ this -> supportedEncodingsWithBom [ $ encoding ] ; $ numBytesInBom = strlen ( $ potentialBom ) ; $ hasBOM = ( $ this -> globalFunctionsHelper -> fgets ( $ filePointer , $ numBytesInBom + 1 ) === $ potentialBom ) ; } return $ hasBOM ; }
Returns whether the file identified by the given pointer has a BOM.

@param resource $filePointer Pointer to the file to check
@param string $encoding Encoding of the file to check
@return bool TRUE if the file has a BOM, FALSE otherwise
Returns whether the file identified by the given pointer has a BOM .