You are here: Re: Extract Content Between Style Tags with Preg and PHP « All PHP « IT news, forums, messages
Re: Extract Content Between Style Tags with Preg and PHP

Posted by Rik on 09/08/06 19:39

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);

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация