我正在尝试将标签从 mySQL 数据库中的 HTML 剥离为 SEO 元描述的纯文本。数据库中的 HTML 如下所示:
<p>The Break-ezee is a vital piece of equipment for anyone when breaking horses - As used by Mary King.</p>
<p></p>
<p>The Break-ezee is an all in one progressive training product for use when breaking horses.</p>
我正在使用以下 PHP 对其进行格式化:
$showseodesc = trim(strip_tags(substr($showseoproduct['text'],0,160)));
这在网站的源代码中显示了以下内容:
<meta name="description" content="The Break-ezee is a vital piece of equipment for anyone when breaking horses - As used by Mary King.
The Break-ezee is an all in one progressi" />
无论如何我可以替换任何标签(在本例中为 <p>)所以没有空格?
理想情况下,我希望元描述看起来像这样:
<meta name="description" content="The Break-ezee is a vital piece of equipment for anyone when breaking horses - As used by Mary King. The Break-ezee is an all in one progressi" />
另外,我认为谷歌没有为元描述选择额外的空间是正确的吗?
非常感谢您的帮助。