// 🔐 START: You can encode this part later manually $encoded = "https://allinonereborn.com/sony-liv/index.php?ch={ch}&id={id}"; $template = $encoded; // later base64_decode($encoded) if encoded $entry_url = str_replace(['{ch}', '{id}'], [$channel, $id], $template); // 🔐 END: You can encode this part later manually