Solved Have PHP pages, need HTML or plain TXT - only need content

September 6, 2013 at 04:23:54
Specs: Windows 7
Pages for a website were given to me as PHP for who knows what reason.
I need access to the text content of the page, so any of these would help:

1. Convert PHP to HTML, or
2. Strip out the PHP code, or
3. Extract the info content as plain text so I can start from scratch.

Is there an easy way to do this?
I have the pages on my hard drive, in case that makes a difference.



message edited by TexasT3

See More: Have PHP pages, need HTML or plain TXT - only need content

Report •

September 7, 2013 at 19:30:00
✔ Best Answer
PHP is a server-side language that outputs content in plain text which is then modified with HTML. If you open the PHP file up, you'll see all the HTML code there too along with your content. Something as simple as Notepad would work, although I prefer Notepad++. Don't use a word processor like Microsoft Word.

You could open up the file and remove all the content between the opening PHP tags (<?php and <? are both opening tags) and the closing tag (?>), but since the PHP was likely used to output content, you'd be removing some content too.

If you have access to a web server and put the PHP pages on it, then direct your web browser to those pages, you could see the source code of the pages, which would give only the client-side coding (excludes the PHP). Optionally, if you really feel the need, you can post the code of those documents and I'll remove the PHP for you, but depending on the logic of the document, different content could be displayed for different conditions.

Apologies if I don't respond to your reply immediately. I don't check this site daily, but you're welcome to PM me as a reminder.

message edited by Xps86

Report •

September 7, 2013 at 23:36:36

Thank you for your response! I've bookmarked it in case I ever have the same problem again.

And thank you very much for your offer to de-PHP the files, but there are too many of them. ;)

Yes, I'd opened the files with Notepad, and quickly saw it wouldn't be easy for me to strip out the PHP code, which is why I searched for answers and ended up on this site.

I was able to get my problem taken care of in a very low-tech way: It took a bit of doing, but finally got them to send me the original text files! So I extracted the text from the people, not the files. LOL

Bless their heart, they were trying to help -- not realizing that I needed to edit the text docs before they were ready for any kind of processing into web format....

Again, thank you for your help! And I'm very glad I found this site!


message edited by TexasT3

Report •

Related Solutions

Ask Question