自己写的一个UBB转换的函数_PHP
function ubb2xhtml($ubb)
{
$flash=
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])\](.*?)\[/h\1\]%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!
);
$replace = array
(
'\2',
'\2',
'',
'',
'sprintf("$flash", "\1", "\2", "\3")',
'\2\1>',
'
'
\n',
'\2',
'\2',
'\2',
'
'
/*
'
- \1
'
- \2
'
- \1
'
- \3
'
*/
"
"\t
"\t
"\t\t
"\t\t
'
\1
'',
'代码
' ',
);
if( preg_match('%\[table=(.*?)\/table\]%s', $ubb, $tablecells) ) //如果有表格, 先去除单元格之间的多余空白
{
$bb=preg_replace('%\]([\r\n\s]*)\[%si', '][', $tablecells[1]);
$ubb=str_replace($tablecells[1], $bb, $ubb);
}
$html = preg_replace($match, $replace, nl2br(htmlspecialchars($ubb)));
$html = preg_replace('/
\s* return $html;
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











1. The SUM function is used to sum the numbers in a column or a group of cells, for example: =SUM(A1:J10). 2. The AVERAGE function is used to calculate the average of the numbers in a column or a group of cells, for example: =AVERAGE(A1:A10). 3. COUNT function, used to count the number of numbers or text in a column or a group of cells, for example: =COUNT(A1:A10) 4. IF function, used to make logical judgments based on specified conditions and return the corresponding result.

Exception handling in C++ can be enhanced through custom exception classes that provide specific error messages, contextual information, and perform custom actions based on the error type. Define an exception class inherited from std::exception to provide specific error information. Use the throw keyword to throw a custom exception. Use dynamic_cast in a try-catch block to convert the caught exception to a custom exception type. In the actual case, the open_file function throws a FileNotFoundException exception. Catching and handling the exception can provide a more specific error message.

When passing a map to a function in Go, a copy will be created by default, and modifications to the copy will not affect the original map. If you need to modify the original map, you can pass it through a pointer. Empty maps need to be handled with care, because they are technically nil pointers, and passing an empty map to a function that expects a non-empty map will cause an error.

This article recommends the top ten digital currency trading apps in the world, including Binance, OKX, Huobi Global, Coinbase, Kraken, Gate.io, KuCoin, Bitfinex, Gemini and Bitstamp. These platforms have their own characteristics in terms of transaction pair quantity, transaction speed, security, compliance, user experience, etc. For example, Binance is known for its high transaction speed and extensive services, while Coinbase is more suitable for novices. Choosing a platform that suits you requires comprehensive consideration of your own needs and risk tolerance. Learn about the world's mainstream digital currency trading platforms to help you conduct digital asset trading safely and efficiently.

Function return value is crucial in C++, which allows the function to return data of a specified type: the return value type defines the type of data returned by the function, including basic types (such as int, float) and custom types (such as pointers, references). The return value meaning varies based on the function's intent, such as returning a result, indicating status, providing a reference, or creating a new object.

This article will provide a detailed introduction to how to install and register a Bitcoin trading application. The Bitcoin trading app allows users to manage and trade cryptocurrencies such as Bitcoin. The article guides users through the installation and registration process step by step, including downloading applications, creating accounts, performing identity verification, and first deposit. The goal of the article is to provide beginners with clear and easy-to-understand guidelines to help them easily enter the world of Bitcoin trading.

Ouyi, also known as OKX, is a world-leading cryptocurrency trading platform. The article provides a download portal for Ouyi's official installation package, which facilitates users to install Ouyi client on different devices. This installation package supports Windows, Mac, Android and iOS systems. Users can choose the corresponding version to download according to their device type. After the installation is completed, users can register or log in to the Ouyi account, start trading cryptocurrencies and enjoy other services provided by the platform.

The pprof tool can help us analyze the internal working principle of Go functions. We can use it to: obtain the function call graph and understand the calling relationship. Analyze function performance and identify bottlenecks. Optimize function memory allocation and reduce memory usage.
