如何验证网站的所有权?

我想创建一个标签,以允许用户声明他的网站的所有权。 我如何得到标签并将其与我生成的标签相匹配。 标签格式为
<!--tag-->
如果我能够使用
file_Get_contents("url");
获取html,我将如何验证此标记     
已邀请:
它只是一个字符串匹配。
<?php
$tagCode = "<!-- abc123 -->";
$pageContent = file_get_contents("http://www.somesite.com/");

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

要回复问题请先登录注册