语法错误:“[”意外[重复]

This question already has an answer here:

The php code displaying unexpected syntax error [ on line number 1 I am not sure what is the issue.

   $shipping_array = [ "AL" => ["a","c","b"],
    "AZ" => ["b","c","a"],
    "AR" => ["a","c","b"],
    "WI" => ["c","a","b"] ];
</div>

You use a short array declaration for that you have to use PHP 5.4 or higher.

Try this under PHP 5.4:

 $shipping_array = array(
    "AL" => array("a","c","b"),
    "AZ" => array("b","c","a"),
    "AR" => array("a","c","b"),
    "WI" => array("c","a","b") 
 );

http://php.net/manual/en/language.types.array.php

This should work for you:

$shipping_array = array(
                    "AL" => array("a","c","b"),
                    "AZ" => array("b","c","a"),
                    "AR" => array("a","c","b"),
                    "WI" => array("c","a","b")
                );

If your using PHP 5.4 or higher you can use this:

$shipping_array = [
        "AL" => ["a","c","b"],
        "AZ" => ["b","c","a"],
        "AR" => ["a","c","b"],
        "WI" => ["c","a","b"]
    ];

For more information take a look here: http://php.net/manual/en/language.types.array.php

problem in your syntax you must try this :

$shipping_array = array( "AL" => array("a","c","b"),
                         "AZ" => array("b","c","a"),
                         "AR" => array("a","c","b"),
                          "WI" => array("c","a","b")
                        );