I have an array that I want a function in my class to split up into two arrays separate arrays. One containing the keys of the first array and the other containing the values of the corresponding elements. Here is the code:
//Array that is set in index page
$array=array("FONT_COLOR"=>"#404040","FONT_COLOR2"=>"#C00000","FONT_COLOR3"=>"#FFFFFF","FONT_COLOR4"=>"#000000");
$test->set_values($array);
//vars set at the begining
var $vars=array();
var $values=array();
//Function
function set_values($array){
foreach($array AS $key=>$value)
{
$this->vars[]=$key;
$this->values[]=$value;
}
}
My problem is that the arrays ($this->vars and $this->values) are not filling with any dataπ
Any help with be appreciated!