-3

I am working with Drupal and I find the several places following way of displaying php variables,

$language->language 

in code

<?php print $language->language; ?>

now I am wondering whether,

$language['language'] and $language->language are both same things,

Thanks

Jees K Denny
  • 531
  • 5
  • 27
codenext
  • 203
  • 3
  • 10
  • 1
    Please read about the difference between an _object_ and an _array_. Objects: http://php.net/manual/en/language.types.object.php Arrays: http://php.net/manual/en/language.types.array.php Objects are kind of "active" data collections, whilst arrays are strictly passive containers. – arkascha Sep 28 '16 at 06:47
  • Thanks to all, I was just in need of that clue, now I got it is array vs object, now I can refer there... – codenext Sep 28 '16 at 07:42

1 Answers1

1

No,

$language['language'] 

is way of accessing array values using indexes. where as

$language->language 

is way of accessing properties of object.

Sagar
  • 642
  • 3
  • 14