A while ago i have written a small php script to get the information from MySQL and put it in XML.Now one the description of the item in the MySQL was up untill now something like
<p>
the item description ...etc.</p>
so far so good, i used the following :
preg_match('#<p>(.*?)</p>#s',$stro, $disp);
and that worked fine as expected.
now today the admin has added the new items in the database like this
<p style="font-family: Tahoma; font-size: 13px; line-height: 19.5px;">
item description...etc</p>
and now my "trick" above doesnt work
now i tried (found this on Stackoverflow)
//first line should strip the "style" part to only
$kulaka = preg_replace('/(<[^>]+) style=".*?"/i', '$1', $stro);
// and here we should remove the p tag
preg_match('#<p>(.*?)</p>#s',$kulaka, $disp);
it 'almost' works but it gives me
"style=font-family: Tahoma; font-size: 13px; line-height: 19.5px;> item
desctiption "
any suggestions are welcomed,and i want to do it generally for all styles atributes not only for this particular one, as the Admin can change the size or font etc