Я не могу понять, почему приведенный ниже код возвращает строку в виде строки, но не в виде HTML,
function en_code($string)
{
# find the match of [br] = a break = <br>
$output = preg_replace('/\[(?: |\s)*([br]+)(?: |\s)*\]/', '<$1 />', $string);
# return the result
return $output;
}
$string = 'Wallace and Gromit\'s Children Foundation the whole campaign was exemplary, showing true professionalism, creativity and an amazing understanding of what makes a strong news story.\'[br][br]Wallace & Gromit\'s Children\'s Foundation';
echo en_code($string);
возвращается,
Wallace and Gromit's Children Foundation the whole campaign was
exemplary, showing true professionalism, creativity and an amazing
understanding of what makes a strong news story.'<br /><br />Wallace &
Gromit's Children's Foundation
но должно вернуться вот так:
Детский фонд Уоллеса и Громита, вся кампания была
образцовый, демонстрирующий истинный профессионализм, креативность и удивительный
понимание того, что делает сильную новость. '
Уоллес и
Детский фонд Громита
Я пытаюсь преобразовать [br]
в <br />
в функции.
Есть идеи?