提交 fad304ad 编写于 作者: 李光春's avatar 李光春

- 链接门面增加获取URL文件格式

上级 3d5ed966
## v6.0.103 / 2020-08-05
- 链接门面增加获取URL文件格式
## v6.0.102 / 2020-08-05 ## v6.0.102 / 2020-08-05
- 数组门面增加数组删除空格 - 数组门面增加数组删除空格
......
...@@ -26,7 +26,7 @@ use think\db\exception\DbException; ...@@ -26,7 +26,7 @@ use think\db\exception\DbException;
/** /**
* 定义当前版本 * 定义当前版本
*/ */
const VERSION = '6.0.102'; const VERSION = '6.0.103';
if (!function_exists('get_ip_info')) { if (!function_exists('get_ip_info')) {
/** /**
......
...@@ -36,6 +36,7 @@ use think\Facade; ...@@ -36,6 +36,7 @@ use think\Facade;
* @method static string toParams(array $data) 格式化参数格式化成url参数 * @method static string toParams(array $data) 格式化参数格式化成url参数
* @method static bool isUrl(string $url) 判断是否为Url * @method static bool isUrl(string $url) 判断是否为Url
* @method static string deleteProtocol(string $url) 删除协议 * @method static string deleteProtocol(string $url) 删除协议
* @method static string retrieve(string $url) 获取URL文件格式
*/ */
class Urls extends Facade class Urls extends Facade
{ {
......
...@@ -104,4 +104,16 @@ class Urls ...@@ -104,4 +104,16 @@ class Urls
} }
return $url; return $url;
} }
/**
* 获取URL文件格式
* @param string $url
* @return mixed|string
*/
public function retrieve(string $url)
{
$path = parse_url($url);
$str = explode('.', $path['path']);
return $str[1];
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册