我是php新手,需要从以下字符串中提取“ url”
href = \“ https://www.youtube.com/watch?v=gYDSNteP_60 \”>胖,对吗?我只是在水平挑战”
网址长度因网址不同而异
任何帮助。
谢谢
尝试这样
$string ="href=\"https://www.youtube.com/watch?v=gYDSNteP_60\">Fat, me? I'm just horizontally challenged";
$regex = '/https?\:\/\/[^\" ]+/i';
preg_match_all($regex, $string, $matches);
print_r($matches[0]);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句