Вопрос

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

    $parameter = http_build_query($so);

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

?>

It causes server error, what is wrong here?

Это было полезно?

Решение

$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']).

Другие советы

It looks like the code should be doing this:

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

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

?>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top