summericeweb Posted April 3, 2006 Share Posted April 3, 2006 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/ Link to comment https://forums.phpfreaks.com/topic/6443-get-source-code/ Share on other sites More sharing options...
Guest footballkid4 Posted April 3, 2006 Share Posted April 3, 2006 [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"...> Link to comment https://forums.phpfreaks.com/topic/6443-get-source-code/#findComment-23370 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.