-3

I'm new ;)

I have two file php (and one problem ;) ):

index.php:

...    
$lang = array();
$lang['En'] = 'Enable';
$lang['Dis'] = 'Disable';
...

and the class.print.php

    ...
include_once 'index.php';
class print{
?? echo $lang['En'] ??
}
    ...

what is the best way to echo a value of the array $lang directly from inside the class?

thanks :)

Tony
  • 1
  • 1
  • 1

1 Answers1

2
include_once 'index.php';

class my_class {
  function __construct(&$lang) {
    var_dump($lang);
  }
}

$my_object = new my_class($lang);
Legionar
  • 7,472
  • 2
  • 41
  • 70