0

This is array in external php file

Array
(
    [0] => Array
        (
            [CurrencyAbbreviation] => AUD
            [CurrencyRate] => 0.50600000
            [DateOfCurrencyRate] => 2013-07-11
            [Units] => 1
        )
)

Want to call for example CurrencyRate

Tried code like $('#currency_load').html(data.CurrencyRate); (Chrome F12 get 404 error).

For comparison. If php array is like this

$arr = array ('item1'=>"I love jquery4u",'item2'=>"You love jQuery4u",'item3'=>"We love jQuery4u");

and json $('#currency_load').html(data.item1);

then all works.

Do I need somehow to modify php array?

2
  • 1
    Your array has a nested array within it, which cannot simply be ignored. data[0].CurrencyRate Commented Aug 24, 2013 at 18:55
  • Yes, nested. Any solution to get element from nested array? Or no solution? Seems only solution is to modify array stackoverflow.com/questions/13205877/… Commented Aug 24, 2013 at 18:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.