Forum Moderators: coopster

Message Too Old, No Replies

Illegal offset type error

         

Kartagis

11:09 am on Jun 20, 2012 (gmt 0)

10+ Year Member



Hi,

I'm trying to use the code
$header = (($layout == 'ver') ? array(t('Currency'), t('Buying'), t('Selling')) : (($layout == 'hor') ? array(t('Currency'), $cur[$curcodes]) : ''));
and getting 'Illegal offset type'. I've done a bit of googling and found out that I can't use t('Currency') and $cur[$curcodes] in the same array. $cur works. Now, what kind of conveniences do I need to use to not get this dreadful error?

Regards,

coopster

5:24 pm on Jun 30, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Kartagis.

Don't use an array or an object as your offset index. Search this PHP manual page for "Illegal offset type" and you will find more information.

[php.net...]