I spend lot of time find out how I can detect messages withdifferent priorities. When I read users notes I rememberfunction imap_fetchheader which show header of messageand additional headers too. Because I'm so lazy to work withregular expressions I required my frend for writing code- thanx Znouza.And there is... :)

Works quite well for splitting headers,$matches will contain 3 arrays:$matches[0] are the full-lines (To: Jille@devnull.quis.cx\r\n)$matches[1] will be the header (To)$matches[2] will be the value (Jille@devnull.quis.cx)

In multi-line values the 'multilining is not stripped!'this could be achieved with something like:<?PHPpreg_replace('/\r\n\s+/m', '', $matches[2]);?>