v2.5.2
Giriş yap

2 karakter arası bulup silme

qplot
602 defa görüntülendi

Merhaba

[foto]otomatik-deger[/foto]

Ben bu [foto] ile başlayan ve [foto] ilet bitenleri bulup içindeki değerlerle beraber silmek istiyorum

Malum

[foto]otomatik-deger[/foto]

[foto]otomatik-deger2[/foto]

[foto]otomatik-deger3[/foto]

diye gidiyor

sanırsam beynım sulandı kod yazmaktan içinden cıkamadım

sync
1257 gün önce
<?php
function cleanBBCode($text_to_search) {
 $pattern = '|[[/!]*?[^[]]*?]|si';
 $replace = '';
 return preg_replace($pattern, $replace, $text_to_search);
}

$text_to_search = "[foto]otomatik-deger[/foto]";

echo cleanBBCode($text_to_search);
?>