public static function text2mailto($data) { $email = '/('; $email .= Sitengine_Regex::getMailbox(); $email .= Sitengine_Regex::getServerName(); $email .= ')/'; return preg_replace($email, '<a href="mailto:\\1">\\1</a>', $data); }
public static function serverName($val) { $p = '/^'; $p .= '((ftp|https?):\\/\\/)?'; # protocol $p .= Sitengine_Regex::getServerName(); $p .= '$/'; return preg_match($p, $val); }