Удалить квадратные скобки из разметки викиPhp

Кемеровские программисты php общаются здесь
Anonymous
Удалить квадратные скобки из разметки вики

Сообщение Anonymous »

Я ищу способ удалить разметку из викитекста.
Пример:

Код: Выделить всё

Mexico, officially the United Mexican States, is a [wiki=1c1ff8db21cf79377f9930e6e6ff8247]country[/wiki] in the southern portion of [wiki=5ffec2d87ab548202f8b549af380913a]North America[/wiki].
Возвращаемый текст должен быть:

Код: Выделить всё

Mexico, officially the United Mexican States, is a country in the southern portion of North America.
Что мы пробовали:

Код: Выделить всё

preg_replace('/(\[.*?.\])/', '', $txt)
Спасибо.

Подробнее здесь: https://stackoverflow.com/questions/728 ... iki-markup

Вернуться в «Php»