Hi,
Can PHP generate text only versions of pages?
PHP generating text only version of pages
Moderator: General Moderators
I'm not sure what you mean. If you want it to dump a webpage with nothing but text, yes it can, you just output text. If you want it to generate a txt file with the contents of a webpage, it can do that to, but differently.
I'm a little confused as to what you mean because this seems like a really simple question. Do you have anything to elaborate on?
I'm a little confused as to what you mean because this seems like a really simple question. Do you have anything to elaborate on?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
I am developing a website that is going to benefit from being accessible.
What I need is for PHP to generate a text only version of a page, and then generate links at the bottom of the page to other text only versions. So basically, what I need is PHP to read a file and strip out anything that is not text and then display the text, with links at the bottom of the page to other pages that are also in this text-only format
What I need is for PHP to generate a text only version of a page, and then generate links at the bottom of the page to other text only versions. So basically, what I need is PHP to read a file and strip out anything that is not text and then display the text, with links at the bottom of the page to other pages that are also in this text-only format
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You mean turn images off and everything... so the data transfer is reduced between client-server?
I don't think there's an actual function to do it, I'd PREFERABBLY wirte new text-only pages and just use them instead since the layout will go all funny if you just take the images out (Unless you carefully place a block div around each image).
Otherwise if you really want to strip out all images then you'd just run a preg_replace() with the appropriate regexp in it.
something like
I don't think there's an actual function to do it, I'd PREFERABBLY wirte new text-only pages and just use them instead since the layout will go all funny if you just take the images out (Unless you carefully place a block div around each image).
Otherwise if you really want to strip out all images then you'd just run a preg_replace() with the appropriate regexp in it.
something like
Code: Select all
preg_replace('/<img src\=".+?">/', '', $page);