当前位置: 网学 > 编程文档 > PHP > 正文

一个用PHP实现的UBB类

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/17
下载{$ArticleTitle}原创论文样式
= ''((''.$this->user.''(:''.$this->password.'')?@)?''.$this->hostport.'')'';

$this->ftptype = ''[aidAID]'';
$this->fsegment = ''((''.$this->uchar.''|[?:@&=])*)'';
$this->fpath = ''(''.$this->fsegment.''(/''.$this->fsegment.'')*)'';
$this->ftpurl = ''([fF][tT][pP]://''.$this->login.''(/''.$this->fpath.''(;[tT][yY][pP][eE]=''.$this->ftptype.'')?)?)'';

$this->fileurl = ''([fF][iI][lL][eE]://(''.$this->host.''|[lL][oO][cC][aA][lL][hH][oO][sS][tT])?/''.$this->fpath.'')'';

$this->search = ''((''.$this->uchar.''|[;:@&=])*)'';
$this->hsegment = ''((''.$this->uchar.''|[;:@&=])*)'';
$this->hpath = ''(''.$this->hsegment.''(/''.$this->hsegment.'')*)'';
$this->httpurl = ''([hH][tT][tT][pP][sS]?://''.$this->hostport.''(/''.$this->hpath.''([?]''.$this->search.'')?)?)'';

$this->gopher_string = ''(''.$this->xchar.''*)'';
$this->selector = ''(''.$this->xchar.''*)'';
$this->gtype = $this->xchar;
$this->gopherurl = ''([gG][oO][pP][hH][eE][rR]://''.$this->hostport.''(/(''.$this->gtype.''(''.$this->selector.''(%09''.$this->search.''(%09''.$this->gopher_string.'')?)?)?)?)?)'';

$this->article = ''((''.$this->uchar.''|[;/?:&=])+@''.$this->host.'')'';
$this->group = ''(''.$this->alpha.''(''.$this->alpha.''|''.$this->digit.''|[-.+_])*)'';
$this->grouppart = ''([*]|''.$this->group.''|''.$this->article.'')'';
$this->newsurl = ''([nN][eE][wW][sS]:''.$this->grouppart.'')'';

$this->nntpurl = ''([nN][nN][tT][pP]://''.$this->hostport.''/''.$this->group.''(/''.$this->digits.'')?)'';

$this->telneturl = ''([tT][eE][lL][nN][eE][tT]://''.$this->login.''/?)'';

$this->wpath = ''(''.$this->uchar.''*)'';
$this->wtype = ''(''.$this->uchar.''*)'';
$this->database = ''(''.$this->uchar.''*)'';
$this->waisdoc = ''([wW][aA][iI][sS]://''.$this->hostport.''/''.$this->database.''/''.$this->wtype.''/''.$this->wpath.'')'';
$this->waisindex = ''([wW][aA][iI][sS]://''.$this->hostport.''/''.$this->database.''[?]''.$this->search.'')'';
$this->waisdatabase = ''([wW][aA][iI][sS]://''.$this->hostport.''/''.$this->database.'')'';
$this->waisurl = ''(''.$this->waisdatabase.''|''.$this->waisindex.''|''.$this->waisdoc.'')'';
}
}

?>


文件otherfunc.php的内容
<?php
//otherfunc.php
function htmlencode($str){
$str = (string)$str;

$ret = '''';
$len = strlen($str);
$nl = false;
for($i=0;$i<$len;$i++){
$chr = $str[$i];
switch($chr){
case ''<'':
$ret .= ''<'';
$nl = false;
break;
case ''>'':
$ret .= ''>'';
$nl = false;
break;
case ''"'':
$ret .= ''"'';
$nl = false;
break;
case ''&'':
$ret .= ''&'';
$nl = false;
break;
/*
case '' '':
$ret .= '' '';
$nl = false;
break;
*/
case chr(9):
$ret .= '' '';
$nl = false;
break;
case chr(10):
if($nl) $nl = false;
else{
$ret .= ''<br>'';
$nl = true;
}
break;
case chr(13):
if($nl) $nl = fal
  • 下一篇资讯: 用php实现广告轮播
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号