making css into an array. in need of regex pointer

    Date: 12/09/06 (PHP Community)    Keywords: css

    if i have some css like that of below and i want to just grab the background image values "/3.5.x/forums/images/placebo_two/daylight/daylight_bg.gif" and store them in an array indexed by the class they're from. i.e.

    array(
    'body' => '/3.5.x/forums/images/placebo_two/daylight/daylight_bg.gif',
    'tcat' => '/3.5.x/forums/images/placebo_two/daylight/daylight_gradient_tcat.gif',
    thead => '/3.5.x/forums/images/placebo_two/daylight/daylight_gradient_thead.gif'
    );


    how would i go about doing that? i figure i can just grab the image locations by matching the brackets? but how i should be trying to match and how to index them on match? i've never wanted to index a regex specifically like this before.


     body
    {
    	background: #ECF2FA url(/3.5.x/forums/images/placebo_two/daylight/daylight_bg.gif) repeat-x top;
    	color: #000000;
    	font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
    	margin: 5px 10px 10px 10px;
    	padding: 0px;
    }
    .tborder
    {
    	background: #4F6BA0;
    	color: #000000;
    	border: 0px solid #4F6BA0;
    	
    }
    .tcat
    {
    	background: #97B1DF url(/3.5.x/forums/images/placebo_two/daylight/daylight_gradient_tcat.gif) repeat-x top left;
    	color: #000000;
    	font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
    	font-variant : small-caps;
    }
    .thead
    {
    	background: #97B1DF url(/3.5.x/forums/images/placebo_two/daylight/daylight_gradient_thead.gif) repeat-x top left;
    	color: #000000;
    	font: bold 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
    }

    Source: http://community.livejournal.com/php/519089.html

« Guilty by association to spam || A matter of preference: »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home