Jump to content

Archived

This topic is now archived and is closed to further replies.

summericeweb

Get SOURCE code

Recommended Posts

I need a function that will allow my to seach throught a file/webpage and get all of the style used.

Examples:
<style>[GET CODE]</style> and get
<Style type="text/css">[GET CODE]</style>


If any one could help it would be very nice. Thank you/

Share this post


Link to post
Share on other sites
Guest footballkid4
[code]<?php
$file = "urltoopen.php";
if ( $data = file( $file ) )
{
     $data = join( "\n" , $data );
     preg_match_all( "@<style[^>].+?>[^>](.*?)[^>]</style>@ism" , $data , $match );
     print_r( $match );
}
?>[/code]
Of course, that won't do much if they use an @import statement or a <link rel="stylesheet"...>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.