Preg_match_all 的问题。

大家好,我还在努力理解preg_match_all,我的多动症大脑尚未看到模式。我有一个包含网页内容的变量。如何抓取所有带有nnnn的链接?谢谢,Rick
 

inwonranu1971

New member
我让这个函数工作了。如何编辑它,以便我只获取其中包含“ nnnn”的url? function getUrls($string){ $ regex ='/ https?:/ / [^" ] / i'; preg_match_all($regex,$ string,$ matches); return($ matches [0]);} // $ urls = getUrls($ string); // print_r($ urls);
 
顶部