Check if string exists in a web page

后端 未结 1 1165
执笔经年
执笔经年 2021-02-11 10:09

I\'m trying to use curl to detect whether a piece of text exists in the source code of a remote webpage. For example, I\'m trying to see if this string exists in the source:

1条回答
  •  闹比i
    闹比i (楼主)
    2021-02-11 11:05

    The two functions you need are cURL and strpos().

    ");
    if ($test==false)
    {
        echo "no";
    }
    else
    {
        echo "yes";
    }
    ?>
    

    0 讨论(0)
提交回复
热议问题