Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 StackOverflow 上,我发现了如何检查是否只存在一个 url:
if (@fopen($url,'r')){ echo 'Exist'; } else { echo 'Does not exist'; }
如何将它与数组一起使用,也许与 while 循环一起使用?
这样我就可以检查超过 1 个 URL。
例如,让它可以检查 50 个 URL?
只需使用 foreach 循环:
foreach ($urlsArray as $url) { if(@fopen($url,'r')){ echo 'Exist'; } else { echo 'Doesnt exist'; } }