0
<?php
    $so = array('marke'=> $_GET["marke"],
                  'farbe'=> $_GET["farbe"],
                  'sort'=> $_GET["sort"]);

    $parameter = http_build_query($so);

    $unsetfarbe = unset($parameter['farbe']);

?>

它导致服务器错误,这里有什么问题?

4

2 回答 2

3

$parameter is not an array. It is a string that your created using http_build_query(). So you're trying to access a variable that doesn't exist ($parameter['farbe']).

于 2013-09-25T15:27:56.383 回答
1

看起来代码应该这样做:

<?php
    $so = array('marke'=> $_GET["marke"],
                  'farbe'=> $_GET["farbe"],
                  'sort'=> $_GET["sort"]);

    unset($so['farbe']);
    $parameter = http_build_query($so);

?>
于 2013-09-25T15:32:32.843 回答