mghelp
Goto Top

preg match all bricht ab

$reg_exp = "/\[n\](\w)\[\/n\]/si"; //zwischen [n] und [/n] soll das wort herausgefiltert werden
und im text sind mehrere [n] bbcodes.
preg_match_all ($reg_exp, $html , $matches) ;

es wird Ja in einem Array gespeichert -> Für Array[$x] (TEXT) Text erstelle ich jeweils ein Bild.

Es klappt zwar, aber Es bricht nach 2 Ergebnissen ab.

Bsp:
[n]hans peter[/n] und [n]hans muster[/n] und weitere.....

Es werden die 2 nur im Array gespeichert -> die nachfolgenen werden nicht im Array gespeichert.

Danke für Hilfe ich verzweifle.

Hier ist die Lösung
stand aufn Schlauch
<?php
function txttoimg($html){
$reg_exp = "/\[x\](.*?)\[\/x\]/si";   
preg_match_all ($reg_exp, $html , $matches) ;

for($x=0; $x<=count($matches[1]);$x++)
	{
	$text = $matches[1][$x];
	}

return($text);
}

print_r( txttoimg($html));
?>

Content-Key: 90780

Url: https://administrator.de/contentid/90780

Printed on: April 26, 2024 at 05:04 o'clock