1

Having problems getting the value 90000 from the array below. Shouldn't it just be below with php:

array["#SALDO"]["1220"]["#UB"]["-1"]

Or are numbers in keys not possible?

array (
[#SALDO] => Array
    (
        [1220] => Array
            (
                [#UB] => Array
                    (
                        [-1] => 90000.00
                        [0] => 10000.00
                    )

            )

        [1229] => Array
            (
                [#UB] => Array
                    (
                        [-1] => -20000
                        [0] => -18000
                    )

            )
)
4
  • 1
    @Devon It should work. "Integerish" strings are always converted to integers by PHP when dealing with array keys. Commented Sep 10, 2017 at 15:23
  • 1
    Yes, I just tested it @ShiraNai7, you are correct. Commented Sep 10, 2017 at 15:25
  • 1
    What's the error you're getting? Which index is the specific problem? Commented Sep 10, 2017 at 15:27
  • Totally correct. Something else seems to be messing in my code. Thanks! Commented Sep 10, 2017 at 15:54

1 Answer 1

1

You should use numerical index when needed eg: 1220 instead of "1220" and -1 instead of "-1"

 array["#SALDO"][1220]["#UB"][-1]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.