QRCode.class.php
public function photo($sImgUrl)
    {
        $bIsImgExt = strtolower(substr(strrchr($sImgUrl, '.'), 1)); // Get the file extension.

        if ($bIsImgExt == 'jpeg' || $bIsImgExt == 'jpg' || $bIsImgExt == 'png' || $bIsImgExt == 'gif') {
            $sExt = strtoupper($bIsImgExt);
        } else {
            throw new InvalidArgumentException('Invalid format Image!');
        }

        $this->sData .= 'PHOTO;VALUE=URL;TYPE=' . $sExt . ':' . $sImgUrl . "\n";

        return $this;
    }
public function photo($sImgUrl)
    {
        $bIsImgExt = strtolower(substr(strrchr($sImgUrl, '.'), 1)); // Get the file extension.

        if ($bIsImgExt == 'jpeg' || $bIsImgExt == 'jpg' || $bIsImgExt == 'png' || $bIsImgExt == 'gif') {
            $sExt = strtoupper($bIsImgExt);
        } else {
            throw new InvalidArgumentException('Invalid format Image!');
        }

        $this->sData .= 'PHOTO;VALUE=URL;TYPE=' . $sExt . ':' . $sImgUrl . "\n";

        return $this;
    }
public function photo ( $ sImgUrl ) { $ bIsImgExt = strtolower ( substr ( strrchr ( $ sImgUrl , '.' ) , 1 ) ) ; // Get the file extension. if ( $ bIsImgExt == 'jpeg' || $ bIsImgExt == 'jpg' || $ bIsImgExt == 'png' || $ bIsImgExt == 'gif' ) { $ sExt = strtoupper ( $ bIsImgExt ) ; } else { throw new InvalidArgumentException ( 'Invalid format Image!' ) ; } $ this -> sData .= 'PHOTO;VALUE=URL;TYPE=' . $ sExt . ':' . $ sImgUrl . "\n" ; return $ this ; }
Photo (avatar).

@param string $sImgUrl URL of the image.

@return self

@throws InvalidArgumentException If the image format is invalid.
Photo ( avatar ) .