Passing arrays as url parameter

前端 未结 10 1851
礼貌的吻别
礼貌的吻别 2020-11-22 12:32

What is the best way that I can pass an array as a url parameter? I was thinking if this is possible:

$aValues = array();

$url = \'http://www.example.com?a         


        
10条回答
  •  不要未来只要你来
    2020-11-22 12:42

    This is another way of solving this problem.

    $data = array(
                  1,
                  4,
                 'a' => 'b',
                 'c' => 'd'
                  );
    $query = http_build_query(array('aParam' => $data));
    

提交回复
热议问题