0
안녕하세요, 아주 기본적인 bbcode 파서를 사용하고 있습니다.중첩 된 bb 코드 인용 방법>
내 문제를 도와 줄 수 있습니까?
하지만, 예를 들어이 기록 된 경우 :[quote=tanab][quote=1][code]a img{
text-decoration: none;
}[/code][/quote][/quote]
출력은 이것이다 :
tanab said:
[quote=1]
a img{
text-decoration: none;
}
[/quote]
가 어떻게
가서 그 문제를 해결까요? 전체 preg_replace 물건에 메신저 realllly 나쁜.이
내 파서 :function bbcode($input){
$input = htmlentities($input);
$search = array(
'/\[b\](.*?)\[\/b\]/is',
'/\[i\](.*?)\[\/i\]/is',
'/\[img\](.*?)\[\/img\]/is',
'/\[url=(.*?)\](.*?)\[\/url\]/is',
'/\[code\](.*?)\[\/code\]/is',
'/\[\*\](.*?)/is',
'/\\t(.*?)/is',
'/\[quote=(.*?)\](.*?)\[\/quote\]/is',
);
$replace = array(
'<b>$1</b>',
'<i>$1</i>',
'<img src="$1">',
'<a href="$1">$2</a>',
'<div class="code">$1</div>',
'<ul><li>$1</li></ul>',
' ',
'<div class="quote"><div class="quote-writer">$1 said:</div><div class="quote-body">$2</div></div>',
);
return preg_replace($search,$replace,$input);
}
하나님의 사랑을 위해, t BBCode 사용] (http://stackoverflow.com/questions/3788959/regex-to-split-bbcode-into-pieces/3792262#3792262)? – NullUserException
무엇을 고치려고합니까? 문제가 무엇입니까? – afuzzyllama
가능한 중첩 된 bb 코드가 중복되지 않습니다. (http://stackoverflow.com/questions/7198302/nested-bb-codes-wont-do-what-i-want) – mario