$s

"; } $returnStr=self::ProcessPopulateString($returnStr); return $returnStr; } public static function CloseOpenTag($str){ $matches=array(); preg_match_all('@.*\[([a-z]*) ?[^/]*?\](.*)$@ms', $str, $matches); //(?![\[/\1\]]) if (count($matches[0])==0 || preg_match_all('@\[/'.$matches[1][0].'\]@', $matches[2][0])>0) return $str; $closeTag='[/'.$matches[1][0].']'; return $str.PHP_EOL.$closeTag; } }