最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php ubb转换成html,html转换成ubb代码
时间:2009-12-09 编辑:简简单单 来源:一聚教程网
php ubb转换成html,html转换成ubb代码
function htmlToUBB($str)
{
$str = preg_replace("/]+src="([^"]+)"[^>]*>/i","[img]$1[/img]",$str);
$str = preg_replace("//i","[video]$1[/video]",$str);
return $str;
}
function UBB($str)
{
$auto_arr = array(
"/(?<=[^]a-z0-9-="'\/])((https?|ftp|mms|rtsp)://)([a-z0-9/-_+=.~!%@?#%&;:$\│]+)/i",
"/(?<=[^]a-z0-9/-_.~?=:.])([_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4}))/i",
"/[img](.+?)[/img]/is",
"/[video](.+?)[/video]/is"
);
$auto_url = array(
'\1\3',
'\0',
'',
''
);
$str = preg_replace($auto_arr,$auto_url," ".$str);
$str = nl2br($str);
return $str;
}
-
上一个: php 邮件验证与图片正则表式程序
-
下一个: php 读取目录文件夹列表程序
相关文章
- php实现word转html文档的例子 03-14
- PHP将HTML转换成文本一些方法总结 09-07
- php html格式转文本格式代码 04-03
- php 符转换为 HTML 实体 11-30
- html 转换php 代码 03-25
- html 转换成php代码 03-25