php - HTML being displayed as text
When I load the following code using php...
<?php <h1>Some text</h1> ?>
the tags are printed as text -
<h1>Some text</h1>
Any ideas?
Found the answer - see my answer.
Answer
Solution:
You need to output the actual HTML code if you are placing any HTML code within PHP.
You can achieve this using .
<?php
echo("<h1>Some text</h1>");
?>
Answer
Solution:
<h1><?php Some text ?></h1>
why dont you try this.
Answer
Solution:
You must print it in order for it to appear the way you want it to
<?php echo"<h1>Some text</h1>" ?>
like this
Answer
Solution:
Found the issue, the content-type was set as json.
Answer
Solution:
<?php echo "<h1>Some text</h1>"; ?>
<?php echo "<h1>Some text</h1>"; ?>
if you want to show a variable
<?php
$_varTest=2;
echo "<h1>Show variable {$_varTest}</h1>"; ?>
Source