06-22-2012, 03:22 PM
[eluser]OKIEWARDOYO[/eluser]
I have a code like below
Note that $options is a variable in file options.inc.php
I'm confusing, where is the best place to place the line of code include "options.inc.php";
i want the code like below
thanks
I have a code like below
Note that $options is a variable in file options.inc.php
Code:
class Welcome extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
include "options.inc.php";
return $options['status_index'];
}
function read()
{
include "options.inc.php";
return $options['status_read'];
}
function write()
{
include "options.inc.php";
return $options['status_write'];
}
}
I'm confusing, where is the best place to place the line of code include "options.inc.php";
i want the code like below
Code:
class Welcome extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
global $options;
return $options['status_index'];
}
function read()
{
global $options
return $options['status_read'];
}
function write()
{
global $options
return $options['status_write'];
}
}
thanks