Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/158.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在元标记中使用换行符_Php_Html_Meta Tags_Line Breaks - Fatal编程技术网

Php 在元标记中使用换行符

Php 在元标记中使用换行符,php,html,meta-tags,line-breaks,Php,Html,Meta Tags,Line Breaks,我想在我的网站描述元标记中使用换行符。我该怎么做,因为如果我看到源代码,它仍然只会显示。我在我的代码中使用了如下内容: <meta name="description" content="<?php echo $gotAlias ?><br/> abc: <?php echo $got_overallrating ?>.<br/> <a href='www.abc.com'>Visit www.abc.com</a>

我想在我的网站描述元标记中使用换行符。我该怎么做,因为如果我看到源代码,它仍然只会显示

。我在我的代码中使用了如下内容:

<meta name="description" content="<?php echo $gotAlias ?><br/>
abc: <?php echo $got_overallrating ?>.<br/>
<a href='www.abc.com'>Visit www.abc.com</a>
">

尝试
“\n”
而不是

,例如

要在添加此元内容标记时使用,将忽略\n。 所以它不起作用。

//元标记
//META TAGS
add_action( 'wp_head', 'tws_output_meta_tags', 5 );
function tws_output_meta_tags() {
    echo '<meta name="author" content="content text" />'."\n";   

}
添加动作('wp_head','tws_output_meta_tags',5); 函数tws_输出_元_标记(){ 回显“”。“\n”; }
我很想知道为什么需要换行符。就像我将我的页面分享给FB和所有人一样……所以我需要在那里清楚地描述我的描述