我如何找到并返回有一些字符的单词?
$text = "Hi this is my website link: http://sub.link.com and an other one is lib.link.com/ex?indo=xb also another one link.com/lol.php"
preg_match("/\blink.com\b/", $text, $matches);
print_r($matches);
使用我的代码,它只返回与'blink.com'相匹配的相同单词但是我需要返回匹配单词的完整文本:
http://sub.link.com , lib.link.com/ex?indo=xb , link.com/lol.php
那怎么可能呢? TY