开发者

How to verify the ownership of a website?

开发者 https://www.devze.com 2023-02-21 22:54 出处:网络
I want to create a tag to allow user to claim the ownership of his website. How would I get the tag and the match it against the one I have generated.

I want to create a tag to allow user to claim the ownership of his website.

How would I get the tag and the match it against the one I have generated.

The tag format will be <!--tag-->

how will I verify this tag if I am ab开发者_JAVA百科le to get the html using file_Get_contents("url");


it's just a string match.

<?php
$tagCode = "<!-- abc123 -->";
$pageContent = file_get_contents("http://www.somesite.com/");

if (strpos($pageContent, $tagCode) !== false) {
    echo "it matched!";
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号