2016-05-19 2 views
-1

Wie bekomme ich Array mit allen String.BBcode-Tags aus dem gesamten Spiel entfernen

$str = "This is some a text with [b]Bold[/b] and [i]Italic[/i] elements inside"; 

preg_match_all("/.*(\[.+\]).*/isU",$str,$matches); 

print_r($matches); 

I erhalten nur:

Array (
    [0] => Array 
     (
      [0] => This is a text with [b] 
      [1] => Bold[/b] 
      [2] => and [i] 
      [3] => Italic[/i] 
     ) 

    [1] => Array 
     (
      [0] => [b] 
      [1] => [/b] 
      [2] => [i] 
      [3] => [/i] 
     ) 

) 

ohne "Elemente innerhalb" Text am Ende.

+0

zeigen, wie Sie – RomanPerekhrest

Antwort