function my_preg_match($pattern, $subject)
{
// start regullar expression
preg_match($pattern, $subject, $out);
// if there is some result... process it and return it
if (isset($out[1])) {
// Process CDATA (if present)
if ($this->CDATA == 'content') {
// Get CDATA content (without CDATA tag)
$out[1] = strtr($out[1], array('<![CDATA[' => '', ']]>' => ''));
} elseif ($this->CDATA == 'strip') {
// Strip CDATA
$out[1] = strtr($out[1], array('<![CDATA[' => '', ']]>' => ''));
}
// If code page is set convert character encoding to required
if ($this->cp != '') {
//$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
$out[1] = iconv($this->rsscp, $this->cp . '//TRANSLIT', $out[1]);
}
// Return result
return trim($out[1]);
} else {
// if there is NO result, return empty string
return '';
}
}