File size: 717B
<?php
#----------------------------------#
#**********[WHT] ICQBot************#
# Made by : Sklep #
# E-mail : [email protected] #
# Site : http://Wap-Hack.Ru #
# ICQ : 712788 #
#----------------------------------#
class RTF
{
static function Text($rtf)
{
$text = preg_replace('~(\\\[a-z0-9*]+({[^}]*}){0,1}([ a-z0-9]*;{1}){0,1})~si', '', $rtf);
$find = array("\r", "\n", '\line ', '{', '}');
$replace = array('', '', "\r\n", '', '');
$text = str_replace($find, $replace, $text);
return preg_replace_callback("~\\\'([0-9a-f]{2})~", array('RTF', 'convert'), trim($text));
}
static function convert($symbol)
{
return chr(hexdec($symbol[1]));
}
}