阅读(4661) (9)

GoFrame gstr-域名处理

2022-04-11 15:15:06 更新

IsSubDomain

  • 说明:​IsSubDomain​校验​subDomain​是否为​mainDomain​的子域名。 支持​mainDomain​中的​'*'​。  
  • 格式:

IsSubDomain(subDomain string, mainDomain string) bool

  • 示例:

func ExampleIsSubDomain() {
	var (
		subDomain  = `s.goframe.org`
		mainDomain = `goframe.org`
		result     = gstr.IsSubDomain(subDomain, mainDomain)
	)
	fmt.Println(result)

	// Output:
	// true
}