feat: Nas专题帮助中心

This commit is contained in:
2025-05-06 14:49:30 +08:00
parent 3a83fc42f8
commit bf7cc21156
14 changed files with 930 additions and 0 deletions

View File

@@ -98,3 +98,21 @@ if (!function_exists('thumb')) {
return mb_substr($url, 0, $idx, 'utf-8') . '_thumb' . mb_substr($url, $idx, $len - $idx, 'utf-8');
}
}
if (!function_exists('get_path_from_img_tag'))
{
/**
* 从img标签中获取图片路径
* @param string $img
* @return string
*/
function get_path_from_img_tag(string $img): string
{
$match = preg_match('/<img[^>]+src=[\'"](.*?)[\'"][^>]+>/i', rawurldecode($img), $matches);
if ($match) {
return $matches[1];
}
return '';
}
}