public function isBase64()
    {
        // An empty string is by definition not encoded.
        if ($this->getLength() === 0) return false;

        // Grab the current string value.
        $possiblyEncoded = $this->scalarString;

        // Attempt to decode it.
        $decoded = base64_decode($possiblyEncoded, true);

        // If we get false it can't be base64
        if ($decoded === false) return false;

        // Lets double check
        return (base64_encode($decoded) === $this->scalarString);
    }
public function isBase64()
    {
        // An empty string is by definition not encoded.
        if ($this->getLength() === 0) return false;

        // Grab the current string value.
        $possiblyEncoded = $this->scalarString;

        // Attempt to decode it.
        $decoded = base64_decode($possiblyEncoded, true);

        // If we get false it can't be base64
        if ($decoded === false) return false;

        // Lets double check
        return (base64_encode($decoded) === $this->scalarString);
    }
public function isBase64 ( ) { // An empty string is by definition not encoded. if ( $ this -> getLength ( ) === 0 ) return false ; // Grab the current string value. $ possiblyEncoded = $ this -> scalarString ; // Attempt to decode it. $ decoded = base64_decode ( $ possiblyEncoded , true ) ; // If we get false it can't be base64 if ( $ decoded === false ) return false ; // Lets double check return ( base64_encode ( $ decoded ) === $ this -> scalarString ) ; }
Returns true if the string is base64 encoded, false otherwise.

@return bool
Returns true if the string is base64 encoded false otherwise .