Home >Backend Development >PHP Tutorial >A UBB conversion function written by myself_PHP tutorial

A UBB conversion function written by myself_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:59:05931browse

function ubb2xhtml($ubb)
{
$flash=<< codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="%1$d" height="%2$d">




END;
$match = array
(
'%[url=([^s] )](.*?)[/url]%s',
'%[email=([^s]) ](.*?)[/email]%i',
'%[img width=(d ) height=(d )](.*?)[/img]%s',
'%[img=([^s] )/]%s',
'%[flash width=(d ) height=(d )](.*?)[/flash]%se',
'%[(b|i|u|strike|sup|sub)](.*?)[/1]%s',
'%[h([1-6])](.*?)[/h1]%s',
'%[hr/]%s',
'%[color=([^s] )](.*?)[/color]%s',
'%[font=([^"] )](.*?)[/font]%s',
'%[size=([^s] )](.*?)[/size]%s',
'%[align=(center|right|left)](.*?)[/align]%s',
'%[valign=(middle|top|bottom)](.*?)[/valign]%s',
/*
'%[ul](.*?)[/ul]%s',
'%[ul=(circle|disc|square)](.*?)[/ul]%s',
'%[ol](.*?)[/ol]%s',
'%[ol type=([aAiI1]) start=([a-zA-Z1-9])](.*?)[/ol]%s',
'%[li](.*?)[/li]%s',
*/
'%[table=([^s] ?)](.*?)[/table]%s',
'%[caption](.*?)[/caption]%s',
'%[tr=([^s] ?)](.*?)[/tr]%s',
'%[th](.*?)[/th]%s',
'%[td](.*?)[/td]%s',
'%[note](.*?)[/note]%s',
'%[quote=(.*?)](.*?)[/quote]%s',
'%[code](.*?)[/code]%s',
'%[ ]{2}%s', // make double-spaces truly double-spaces!
);

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631971.htmlTechArticlefunction ubb2xhtml($ubb) { $flash=END object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn