php转发从foreach到结果的链接

<?php
     if(isset($_POST['MarkaSinifi'])) {
        $MarkaSinifi = $_POST['MarkaSinifi'];
        echo "https://www.xxxxx.com/cart.php?a=add&pid=3&configoption[1]=2&customfield[10]=webx";

        foreach($MarkaSinifi as $marka) {
            echo '&configoption[' . $marka . ']=1';
        }
     }
 ?>

I made that code for redirect user every $marka has a value like 1,2,3 this is the result for the link i want to redirect: "https://www.xxxxx.com/cart.php?a=add&pid=3&configoption[1]=2&customfield[10]=webx&configoption[51]=1&configoption[52]=1"

This is just text, but i want to redirect users to that link. How can i do that?

This is what i did: https://coinearn.shop/marka.php

If you know all index of $marka, you can use

<?php
     header('Location: '. "https://www.xxxxx.com/cart.php?a=add&pid=3&configoption$marka[0]=2&customfield[10]=webx&configoption$marka[1]=1&configoption$marka[2]=1");

This can help too

<?php
   $args[0] =  'Location: https://www.xxxxx.com/cart.php?a=add&pid=3&configoption%s=2&customfield[10]=webx&configoption%s=1&configoption%s=1';
   $args = array_merge($args, $marka);
   header(call_user_func_array('sprintf', $args);