|
Posted by Rik on 09/08/06 19:43
Rik wrote:
> ameshkin wrote:
>> This script I wrote works with tables, td's and div's, but not with
>> style tags. Can anyone figure out the regular expression for finding
>> <style> tags. The trick is that sometimes its not just <style> Its
>> <style type="text/css">
>>
>> Basically, i want to take the information in between the style
>> content from any url
>>
>
> Well, for stasters it's closed with </style>, not <\style>....
>
>
> preg_match_all('|<style[^>]*?>(.*?)</style>|si',$html,$matches);
preg_match_all('|<style[^>]*>(.*?)</style>|si',$html,$matches);
is better here...
--
Rik Wasmus
Navigation:
[Reply to this message]
|