嗨,我想把这个小代码转换成 curl。这可能吗?
<?php
$url = 'http://www.example.com/test.php';
$file_headers = @get_headers($url);
if ( strpos($file_headers[0], "200") )
{
$check = @file_get_contents($url);
if (stristr($check,"/Style.js"))
echo "<font color='green'>FOUND</font>";
else
echo "<font color='red'>NOT FOUND</font>";
}
?>
我正在尝试检查站点的状态,然后找出文件 test.php 中是否存在指向文件“/Style.js”(仅此子字符串)的链接。