Search code examples
phphtmlmeta-tagsline-breaks

using line breaks in meta tags


I want to use line breaks in my website description meta tag. How do I do it, because if I see the source code it will still show <br/> only. Something like this I use in my code:

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

Solution

  • Try "\n" instead of <br />, e.g. <?php echo "first line\nsecond line"; ?>;