Ask for a script to convert ubb into html using php (to support tables). well, we can see that ubb can be used in some forums to write tables. In fact, this piece of code can also be provided. The syntax seems to be [tbl] | a1 | s2 | s3 | b1 | b2 | b3 | c1 | c2 | c3 | [/tbl]. of course, you can also use commas to separate them. I cannot write it out because I am too weak .. Thank you for asking for a script to convert ubb into html using php (table support)
Well, we can see that some forums use ubb and you can also write tables.
In fact, this piece of code can also be provided.
The syntax seems to be
[Tbl]
| A1 | s2 | s3 |
| B1 | b2 | b3 |
| C1 | c2 | c3 |
[/Tbl]
Of course, they can also be separated by commas.
I cannot write it out because I am too weak ..
Thank you, php ubb html.
------ Solution --------------------
$ S = <UBB
[Tbl]
------ Solution --------------------
A1
------ Solution --------------------
S2
------ Solution --------------------
S3
------ Solution --------------------
------ Solution --------------------
B1
------ Solution --------------------
B2
------ Solution --------------------
B3
------ Solution --------------------
------ Solution --------------------
C1
------ Solution --------------------
C2
------ Solution --------------------
C3
------ Solution --------------------
[/Tbl]
UBB;
$ S = preg_replace_callback ('/\ [tbl \] (. +) \ [\/tbl \]/isU', 'tbl _ func', $ s );
Echo $ s;
Function tbl_func ($ r ){
$ T = preg_replace (array ('/^ \
------ Solution --------------------
/M ','/\
------ Solution --------------------
\ R? $/M ','/\
------ Solution --------------------
/M'), array ('','',''), $ R [1]);
Return"
";
}
A1 |
S2 |
S3 |
B1 |
B2 |
B3 |
C1 |
C2 |
C3 |
Other tags are processed as examples