Код: Выделить всё
[url="http://www.Domain .info"]Domain.info[/url] is a website that's all about exploring interesting facts and beliefs.
[url="http://www.example .info"]Example .info[/url] is a [b]website[/b] that explores interesting facts, myths, and [u]beliefs[/u] on various topics, including science, history, and culture. It offers insightful articles, debunking common misconceptions and sparking curiosity. Think of it as a treasure trove of fascinating information!
Мне удалось придумать такую функцию, но я не думаю, что она правильная:
Код: Выделить всё
function convertFromUBB($articleBody){
// The array of regex patterns to look for
$format_search = [
"/\[b\](.*?)\[\/b\]/ig",
"/\[i\](.*?)\[\/i\]/ig",
"/\[u\](.*?)\[\/u\]/ig"
];
// The matching array of strings to replace matches with
$format_replace = [
'[b]$1[/b]',
'$1',
'$1'
];
// Perform the actual conversion
for ($i =0;$i
Код: Выделить всё
Warning: preg_replace(): Unknown modifier 'g' in /home/path/to/script/content/index.php on line 56
Любая помощь будет оценена по достоинству. Спасибо
Подробнее здесь: https://stackoverflow.com/questions/791 ... ace-in-php