PHP Use Declared array Variable inside already Declared Array

i have created one class in which i declared public associative array.

class test{
public $basicCols= array(
array(‘title’=>’KEY’, ‘field’=>’slug’,’options’=>$optList),
array(‘title’=>’KEY’, ‘field’=>’slug’),
}

public $optList= array(“one”=>”One”,”two”=>”Two”);

}

But when i execute code its giving me error.
I tried

$this->$optList
$this->optList
$optlist

is there any other way to declare variable inside variable in class. thank you in advance.

Read more here:: PHP Use Declared array Variable inside already Declared Array

Leave a Reply

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