I have an array with strings. The strings shall have line breaks. My code produces the
as text not as tag. How can I manage to create a
tag in the HTML that creates a line break?
<?php return array(
....
'subtitle' => nl2br("My Sentence shall have a \n line break right there") ,
...
);
<title><?php echo htmlspecialchars($CONFIG['subtitle']); ?></title>
Result
My Sentence shall have a <br> line break right there
htmlspecialcharstranslates all<and>to<and>, rendering your html tags to not be interpreted by the browser anymore. If you want to have an actual<br>tag in there, avoidhtmlspecialchars.<title>tag doesn't have a line break or i am missing something?