Hello,

I'm having a weird problem with some PHP when outputting some HTML. For example:

echo "<h1>There are errors!</h1>";
foreach($errors AS $error)
{
    echo $error . '\n';
}
exit();

I want the output to actually show the text in H1 style, however the output is like this:

<h1>There are errors!</h1>

In other words, it isn't processing the HTML.

Any suggestions?

Is the page being served as HTML?

The page you are echoing it on, should have the basic html tags too like :

<html>
<head></head>
<body></body>
</html>

And echo it in the body. I hope this helps.

I get the text displayed as H1 (Firefox 12 on Fedora 16). Maybe you should have a look at the HTML code that your browser displays and see if there are any errors elsewhere (right click on page and select View page source in Firefox).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.