thinkphp6驼峰命名和下划线命名互转
2023-03-29 23:03:03
128
{{single.collect_count}}

1.引用Str库

use think\helper\Str;

2.调用方法

use think\\helper\\Str;// 检查字符串中是否包含某些字符串Str::contains($haystack, $needles)// 检查字符串是否以某些字符串结尾Str::endsWith($haystack, $needles)// 获取指定长度的随机字母数字组合的字符串Str::random($length = 16)// 字符串转小写Str::lower($value)// 字符串转大写Str::upper($value)// 获取字符串的长度Str::length($value)// 截取字符串Str::substr($string, $start, $length = null)//驼峰转下划线Str::snake($value, $delimiter='_')//下划线转驼峰(首字母小写)Str::camel($value)//下划线转驼峰(首字母大写)Str::studly//转为首字母大写的标题格式Str::title($value)
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}