How to Convert HTML to Text PHP
PHP, or PHP: Hypertext Preprocessor, is a server-side web programming language that outputs HTML. In fact, you can use PHP and HTML in the same file. Outputting text in PHP requires a simple command, just as it does in HTML. By using such a command, you can easily take HTML text and write the same thing in PHP.
Instructions
-
-
1
Find the HTML text you are interested in. It will most likely be denoted by style tags, such as paragraph (<p>...</p>) or a specific heading type defined in the CSS (<h1>...</h1>).
-
2
Type "<?php" at the beginning of the file and "?>" at the end of the file. (no quotes)
-
-
3
Re-save the file with the file extension ".php". (no quotes)
-
4
Rewrite or paste the text of interest into the following PHP command, which outputs HTML text:
echo "insert text here";Make sure to include the quotation marks and semicolon, as these are necessary for proper PHP syntax.
-
5
Re-upload the file to your web server or open the .php file in a web browser.
-
1
References
- Photo Credit computer image by blaine stiger from Fotolia.com