Wordpress - Add multiple value to a query variable in WordPress

I am giving you some solutions whatever you want to use.

Using plus http://myexamplesite.com/store/?brand=nike+adidas+woodland

//Don't decode URL
  <?php
    $brand = get_query_var('brand');
    $brand = explode('+',$brand);
    print_r($brand);
  ?>

using ,separator http://myexamplesite.com/store/?brand=nike,adidas,woodland

$brand = get_query_var('brand');
$brand = explode(',',$brand);
print_r($brand);

Serialize way

<?php $array = array('nike','adidas','woodland');?>
http://myexamplesite.com/store/?brand=<?php echo serialize($array)?>
to get url data
$array= unserialize($_GET['var']);
or $array= unserialize(get_query_var('brand'));
print_r($array);

json way

<?php $array = array('nike','adidas','woodland');
  $tags = base64_encode(json_encode($array));
?>
http://myexamplesite.com/store/?brand=<?php echo $tags;?>
<?php $json = json_decode(base64_decode($tags))?>
<?php print_r($json);?>

using - way

I suggest using mod_rewrite to rewrite like http://myexamplesite.com/store/brand/nike-adidas-woodland or if you want to use only php http://myexamplesite.com/store/?brand=tags=nike-adidas-woodland. Using the '-' makes it search engine friendly.

<?php
    $brand = get_query_var('brand');
    $brand = explode('-',$brand);
    print_r($brand);
?>

In every case, you will get the same result

    Array
    (
        [0] => nike
        [1] => adidas
        [2] => woodland
    )

Tags:

Query