Array problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi there,

I'm having a problem returning the contents of an array, i want to
select the AFA currency only, i can dump the whole array by using,

But i only want the AFA value to be printed tot he screen, i've tried

echo $ExRay[1]["cname"];

but this doesn't return anything, i;m new to arrays so any help would
be greatly appreciated!



    [0] => currency Object
            [csymbol] => AED
            [cname] => United Arab Emirates Dirhams
            [crate] => 6.8712288192

    [1] => currency Object
            [csymbol] => AFA
            [cname] => Afghanistan Afghanis
            [crate] => 80.0505170552

    [2] => currency Object
            [csymbol] => ALL
            [cname] => Albania Leke
            [crate] => 180.5912341387

Re: Array problem

Ian N wrote:
Quoted text here. Click to load it

$ExRay[1] is an object, cname is a member, so use $ExRay[1]->cname.

E. Dronkert

Re: Array problem

Cheers, sorted it thanks

Site Timeline