首页 源码

<?php
/* 
* 花几分钟写的ubb转换html标签实例
 * POWERED BY 雨落凋殇
 */
function ubb($string) { 
$patterns = Array('/\[url=(.*)\](.*)\[\/url\]/U','/\[img=(.*)\](.*)\[\/img\]/U','/\[br\]/','/\[hr\]/');
$replacements = Array('<a href = "\1">\2</a>','<img src = "\1" alt = "\2">','<br />','<hr />');
$str = preg_replace($patterns, $replacements, $string);
return $str;
}?>



文章评论