top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to display HTML tags as plain text in PHP page?

+2 votes
614 views
How to display HTML tags as plain text in PHP page?
posted Apr 11, 2017 by Divya Nayak

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
replace < by &lt; and > by &gt;
answer Apr 13, 2017 by Manikandan J
Similar Questions
0 votes

To get html pages to use php scripts, I've used:

RewriteEngine on
# handler for phpsuexec. -- this makes these prefixes considered for php

SetHandler application/x-httpd-php

In a .htaccess file.
However, it works on one site, but not on another -- any ideas as to why?

+1 vote

I'd like to have the option to download the source code as text/plain from the docs.python.org pages.

For example: when I'm a docs page, such as:
http://docs.python.org/2/library/string.html

and I click the source code link I'm taken to a Mercurial page:
http://hg.python.org/cpython/file/2.7/Lib/string.py

but over there there's no way to get a clean text/plain version of the code because the line numbers are included.

A link to the text/plain version on that page would be nice!

+1 vote

I am working on an OOP project, and cannot decide which way to follow when I have to write a simple function.

For example, I want to write a function which generates a random string. In an OOP environtment, it is a matter of course to create a static class and a static method for that. But why? Isn't it more elegant, if I implement such a simple thing as a plain function? Not to mention that a function is more efficient than a class method.

So, in object-oriented programming, what is the best practice to implement such a simple function?

...