gf: github.com/gogf/gf/g/encoding/ghtml Index | Files

package ghtml

import "github.com/gogf/gf/g/encoding/ghtml"

Package ghtml provides useful API for HTML content handling.

HTML编码.

Index

Package Files

ghtml.go

func Entities Uses

func Entities(s string) string

本函数各方面都和SpecialChars一样, 除了Entities会转换所有具有 HTML 实体的字符。 参考:http://php.net/manual/zh/function.htmlentities.php

func EntitiesDecode Uses

func EntitiesDecode(s string) string

Entities 的相反操作 参考:http://php.net/manual/zh/function.html-entity-decode.php

func SpecialChars Uses

func SpecialChars(s string) string

将html中的部分特殊标签转换为html转义标签 参考:http://php.net/manual/zh/function.htmlspecialchars.php

func SpecialCharsDecode Uses

func SpecialCharsDecode(s string) string

将html部分转义标签还原为html特殊标签 参考:http://php.net/manual/zh/function.htmlspecialchars-decode.php

func StripTags Uses

func StripTags(s string) string

过滤掉HTML标签,只返回text内容 参考:http://php.net/manual/zh/function.strip-tags.php

Package ghtml imports 3 packages (graph) and is imported by 4 packages. Updated 2019-02-03. Refresh now. Tools for package owners.