mirror of
https://git.beihong.wang/wangbeihong/blog-source.git
synced 2026-04-23 11:23:03 +08:00
39 lines
516 B
PHP
Executable File
39 lines
516 B
PHP
Executable File
<?php
|
|
|
|
namespace IXR;
|
|
|
|
/**
|
|
* IXR Base64编码
|
|
*
|
|
* @package IXR
|
|
*/
|
|
class Base64
|
|
{
|
|
/**
|
|
* 编码数据
|
|
*
|
|
* @var string
|
|
*/
|
|
private string $data;
|
|
|
|
/**
|
|
* 初始化数据
|
|
*
|
|
* @param string $data
|
|
*/
|
|
public function __construct(string $data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* 获取XML数据
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getXml()
|
|
{
|
|
return '<base64>' . base64_encode($this->data) . '</base64>';
|
|
}
|
|
}
|