Removing internal styles from each .html file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mubashir09
Forum Newbie
Posts: 1
Joined: Sat Sep 20, 2008 6:25 am

Removing internal styles from each .html file

Post by mubashir09 »

Hi
i have hundreds of pages on my website which use internal styles sheet for each page. But now i want to remove internal styles and will put just a single external style sheet as internal style sheet are taking more bandwidth.

Can any body help me how i can remove everything between <style>....</style> inside my all html pages.

i have done so far is

filename = $file;

//reading file contents
$handle = fopen($filename, "r+");
$contents = fread($handle, filesize($filename));
fclose($handle);


dont know what to do further .....

waiting for someone help.
thanx
adroit
Forum Commoner
Posts: 37
Joined: Fri Aug 08, 2008 1:25 am
Location: India
Contact:

Re: Removing internal styles from each .html file

Post by adroit »

Hi Friend,

You can use Dreamweaver or editplus to find and replace content between the tags. You have to properly use the different options while searching the content between the tags.

And one thing, just don't forget to take backup of all the files.

Regards
Post Reply