-4

I have this error message "Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'" , as I want to create 2D of array to pass the 2 keys into foreach loop .

$productIds = array
  (
  [0] => Array
        (
            [SKU] => 'xx'
            [Price] => 22

        )

    [1] => Array
        (
            [SKU] => 'bb',
            [Price] => 15,

        )

    [2] => Array
        (
            [SKU] => 'cc',
            [Price] => 5,

        )
    [3] => Array
        (
            [SKU] => 'tt',
            [Price] => 17,

        )
Mo Salah
  • 3
  • 1
  • 7

1 Answers1

0

I think you are missing a comma in your array when you create that array, it should be:

 Array
    (
        [SKU] => 'xx',
        [Price] => 22

    )

Instead of

 Array
    (
        [SKU] => 'xx'
        [Price] => 22

    )
Long Kim
  • 490
  • 3
  • 9