我的Php mysql输出是数组,我需要如果字符串包含特定字符,我需要打印字符串
while($row2 = mysqli_fetch_array($result2)) {
echo $row2['link'];
}
Output is:
http://www.videoweed.es/file/b38300afda3e6
http://www.novamov.com/video/303a4428f6c6a
http://www.movshare.net/video/081aaa1356a6b
我需要这样
if (strpos($a,'videoweed') !== false) {
echo $row2['link'];
}
它显示输出是:
http://www.videoweed.es/file/b38300afda3e6
http://www.novamov.com/video/303a4428f6c6a
http://www.movshare.net/video/081aaa1356a6b
我只需要输出;
http://www.videoweed.es/file/b38300afda3e6
您的代码中有答案。只需要把它组装起来。检查:-
while($row2 = mysqli_fetch_array($result2)) {
if (strpos($row2['link'],'videoweed') !== false) {
echo $row2['link'];
}
}