Forum Moderators: coopster
Code:
Here is an explanation.
The "/" marks the begining of the expression.
The "\" says do not use the special meaning of the next character.
The "{" says find "{".
The "." says find any character.
The "*" says find zero or more of the previous character (which was any character).
The "?" says don't be "greedy," which means match as few characters as possible before the next element in the match.
The "\" says do not use the special meaning of the next character.
The "}" says find "}". And the "/" marks the end.
If you don't use the "?" you get a "greedy" match of everything from the first "{" to the last "}", "{tag1} and {tag2}" */
//Here is the function
function replacer($text)
{
preg_match_all( '/\{.*?\}/', $text, $tags );
foreach ($tags[0] as $loop_result)
{
echo $loop_result."";
}
$repinfo = "";
return $repinfo;
}
--> end of code
It doesn't show anything, does anyone know why this is happening and if so please help
thanks