You are here: Re: php's preg_match_all() and css classes... « PHP Programming Language « IT news, forums, messages
Re: php's preg_match_all() and css classes...

Posted by Oli Filth on 11/15/15 11:26

kevinC said the following on 12/09/2005 21:38:
> Hello,
>
> I'm trying to parse out the properties of a class definition from a css
> file and am running into issues trying to write the reg. expression:
>
> h1 {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 16px;
> font-weight: bold;
> color: #003399;
> }
> ...
>
> I need the results in:
> array[i][0] = "h1"
> array[i][1] = "
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 16px;
> font-weight: bold;
> color: #003399;"
>
> Any idea? I tried looking online for an example and can't find anything
> that works with php's preg_match_all() function...
>

preg_match_all('/\s*(.*)\s*\{\s*(.*)\s*\}/sU', $str, $array,
PREG_SET_ORDER);


P.S. Please cross-post rather than multi-post.

--
Oli

 

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

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