Here’s a simple way to display HTML tags/formating on your php page.
You can use the htmlspecialchars().
Example:
Hello this is bold This is italic This is normal this is a double quote ” this is & this is less than < this is greater than >
The html part of the above line is here
<b>Hello this is bold</b> <i>This is italic</i> This is normal this is a double quote ” this is & this is less than < this is greater than >
Now to display the code for the above line formatted in different style we have to use htmlspecialchars funciton like this
$contents=”<b>Hello this is bold</b> <i>This is italic</i> This is normal this is a double quote ” this is & this is less than < this is greater than >”;
echo htmlspecialchars($content);
echo htmlspecialchars($content);




Comments
There are no comments for this post.
Write a Comment