Php正则表达与Strtolower帮助需要 [英] Php Regex With Strtolower help Need
本文介绍了Php正则表达与Strtolower帮助需要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ text ='嗨#How are you';
我需要
$输出=你好< a < span class =code-attribute> href = / how > #How < / a >
我需要从$ text中提取Hashtag,然后将其替换为链接标签部分转换为小写并保留主题标签,因为它是
解决方案
text ='嗨#How are you';
我需要
输出=你好< a href = / how > #How < / a >
我需要从中提取Hashtag blockquote>
文本然后将其替换为带有标签部分转换为小写的链接并保留主题标签
$text = 'Hi #How are you'; I need $Output = Hi <a href="/how">#How</a> I need to extract Hashtag from the $text and then replace it with a link with hashtag part converted to lowercase and leave hashtag as it is解决方案text = 'Hi #How are you'; I need
Output = Hi <a href="/how">#How</a> I need to extract Hashtag from the
text and then replace it with a link with hashtag part converted to lowercase and leave hashtag as it is
这篇关于Php正则表达与Strtolower帮助需要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文