我想这样做:
如果php 在 html 源代码中找到了这个特定的元标记,则从标题中删除:
<meta property="og:video:type" content="application/x-shockwave-flash" /> <meta property="og:video" content="https://www.neocsatblog.info/jwplayer/player.swf?file=&autostart=true&skinName=newtube&skinURL=https%3A%2F%2Fneocsatblog.info%2Fskinning-sdk%2Ffive%2Fnewtube%2Fnewtube.xml" />
我试过这种方式,但不工作:
if ( $fullmeta == '<meta property="og:video:type" content="application/x-shockwave-flash" /> <meta property="og:video" content="https://www.neocsatblog.info/jwplayer/player.swf?file=&autostart=true&skinName=newtube&skinURL=https%3A%2F%2Fneocsatblog.info%2Fskinning-sdk%2Ffive%2Fnewtube%2Fnewtube.xml" />') {
$fullmeta="";
}
声明完整元数据的完整代码块:
<?
$video_url = get_field('video_urlasd');
if (isset($video_url) && $video_url !== "https://") {
$meta1='<meta property="og:video:type" content="application/x-shockwave-flash" />';
$skinURL="https://neocsatblog.info/skinning-sdk/five/newtube/newtube.xml";
$meta2=' <meta property="og:video" content="https://www.neocsatblog.info/jwplayer/player.swf?file='.urlencode($video_url).'&autostart=true&skinName=newtube&skinURL='.urlencode($skinURL).'" />';
$fullmeta=$meta1.$meta2;
echo $fullmeta;
}else{
echo chop($fullmeta,"asd");
}
if ( $fullmeta == '<meta property="og:video:type" content="application/x-shockwave-flash" /> <meta property="og:video" content="https://www.neocsatblog.info/jwplayer/player.swf?file=&autostart=true&skinName=newtube&skinURL=https%3A%2F%2Fneocsatblog.info%2Fskinning-sdk%2Ffive%2Fnewtube%2Fnewtube.xml" />') {
echo $fullmeta="";
}
?>
我不知道为什么,因为在 HTML 源代码上我找到了它,看起来和我复制的一样!