<?php
/**
* core class
*/
class Core
{
public $token;
function __construct()
{
$token = file_get_contents('data.config');
}
function getToken () {
echo $this->token;
}
}
$core = new Core();
$core->getToken();
<?php
/**
* core class
*/
class Core
{
public $token;
public function __construct()
{
$this->token = file_get_contents('data.config');
}
public function getToken () {
return $this->token;
}
}
$core = new Core();
echo $core->getToken();