Check if URL is indexed by Google using PHP

前端 未结 4 1953
太阳男子
太阳男子 2021-01-18 18:24

I would like to know if it\'s possible to check if URL is indexed by Google using PHP.

Is this against their ToS?

4条回答
  •  长发绾君心
    2021-01-18 19:10

    For polish language you should try check between UTF-8 and ISO-8859-2 like this:

    $encAry = array('ISO-8859-2', 'UTF-8');
    $contentEncoding = mb_detect_encoding( $content, $encAry );
    $googleSearchResult = mb_convert_encoding($content, 'UTF-8', $contentEncoding);
    

    Works for me.

提交回复
热议问题