Can we define constant array in Codeigniter.?

Can we define constant array in Codeigniter.?

$data = array();
$data[] = 'aaa'; 
$data[] = 'bbb'; 
$data[] = 'ccc'; 

//encode array in json format
$newdata = json_encode($data);

//the simple assign the constant.
define('DATA',  $newdata);

Leave a Reply

Your email address will not be published. Required fields are marked *