Syntax error in PHP reset () command

0

Is this syntax incorrect?

$impostos[$value['prod']['cProd']]['ICMS']['vicms']=reset($value['imposto']['ICMS'])['vICMS'];

My question is regarding the command reset() if it can be used in this way

You are giving 500 Internal Server Error error on my PHP page

And when I open with Dreamweaver it indicates that this line is incorrect

    
asked by anonymous 22.09.2015 / 14:41

1 answer

3

One tip is to turn on displaying errors while developing, making it easier to find problems.

If you want to try another way with the reset () function, you can assign the return on a variable and access the index you want:

$firstElement = reset($value['imposto']['ICMS']);
$impostos[$value['prod']['cProd']]['ICMS']['vicms'] = $firstElement['vICMS'];
    
22.09.2015 / 15:03