$_SERVER[‘HTTP_HOST’]获取当前域名,parse_url()解析地址。
<?php if ($_SERVER['HTTP_HOST'] != parse_url($meta['pro_link'])["host"]) {echo 'target="_blank" rel="noopener noreferrer"';}?>
$_SERVER[‘HTTP_HOST’]获取当前域名,parse_url()解析地址。
<?php if ($_SERVER['HTTP_HOST'] != parse_url($meta['pro_link'])["host"]) {echo 'target="_blank" rel="noopener noreferrer"';}?>