Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-06-2006, 05:28 PM   PM User | #1
robojob
Regular Coder

 
Join Date: Jul 2005
Location: Oxfordshire, UK
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
robojob is an unknown quantity at this point
Text only

Any ideas on where i can find a server side script either php or Perl/CGI that will convert any html page into text only for accessibilty.??
robojob is offline   Reply With Quote
Old 05-07-2006, 02:03 PM   PM User | #2
BonRouge
Regular Coder

 
BonRouge's Avatar
 
Join Date: Mar 2006
Location: Sendai, Japan
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
BonRouge is on a distinguished road
You do mean to convert one of your own pages to plain text, don't you? From the same server?

This should do it...
Code:
<?php
$file = file_get_contents("filename.htm");
$text = preg_replace("/\<sty(.+?)\yle>/is", "", $file);
echo strip_tags($text);
?>
(Just put the filename in).
__________________
bonrouge
BonRouge is offline   Reply With Quote
Old 05-07-2006, 03:38 PM   PM User | #3
GJay
Senior Coder

 
Join Date: Sep 2005
Posts: 1,791
Thanks: 5
Thanked 36 Times in 35 Posts
GJay is on a distinguished road
there's no reason to strip out the HTML, things like headings and paragraphs help to make pages make sense.
Just make sure that the pages you make don't rely on images, colour or bizarre positioning to make sense, and users should be able to browse the site how they prefer, whether that be with a 'regular' browser, a text-based one or a screen-reader.
GJay is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:10 AM.


Advertisement
Log in to turn off these ads.