我有哪些用户将其引用的Tagging测试,所以我需要从文本链接的href像我有一个文本preg_math获取文本中的网址
Hello World <a class="red" contenteditable="false" href="http://domainname.com/demo/forums/profile/test.name">Test </a> this is creating a problem
//I need test.name from the url
$text = $post_data->discussion;
$name = preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $text, $match);
print_r($name);
谁能帮助我,因为我无法这样做我没有做出正则表达式
你必须使用正则表达式,或者您可以使用HTML解析库? –
这个问题迄今为止在SO上单独回答了多少次? 56390574903次? – arkascha
@arkascha从来没有问过这个问题,为什么你把这件事归咎于我? –