How to loop through, match and replace?
问题 I have multiple strings with same curly braces I want to replace them as dynamic if I get the count as 1 then need to replace the first occurrence, If count as 2 then replaces the second occurrence as so on until condition satisfies. <?php include_once("con.php"); $db = new Da(); $con = $db->con(); $String = "{{ONE}} {{TWO}} {{THREE}} {{FOUR}} {{FIVE}} {{SIX}}"; $Count = 1; if(preg_match_all("/\{\{[^{}]+\}\}/", $lclString, $matches)) { foreach ($matches[0] as $match) { $Count++; $Query =