0
我想使用的preg_match的preg_match动态文本和回声
$desc = 'this is some text big <a href="//example.com/dynamicID">//example.com/dynamicID</a><br> and some more text here';
$desiredtext = preg_match("//example.com/.*?", $desiredtext, $desc);
echo $desiredtext; //this should return me only //example.com/dynamicID
如何解决这个问题,以得到一个字符串动态文本?
感谢您的回复,但问题是在文本中有多个href如何正确地找到我们需要的?有时在第二个href和第七个href的一些时候所需的文本。 – KenDev
你的第二个和第三个参数是相反的,并且你在存储1,0或者'FALSE',你想要存储匹配 – sidyll
你能准确地描述“我们需要什么”吗?你正在寻找一个特定的网址或死于它必须在特定的''? – cars10m