I have a array as $result which i got from this select operation.I am using codeigniter
$this->db->select('*');
$this->db->from($table);
$this->db->where('User_Id',$User_Id);
$query = $this->db->get();
$results = $query->result();
$result = $results[0];
I want to save this values in a variables .what i am doing is
$HeightFrom=$result->HeightFrom;
$HeightTo=$result->HeightTo;
$MaritalStatus=$result->MaritalStatus;
$Religion=$result->Religion;
$MotherTongue=$result->MotherTongue;
$Community=$result->Community;
$ProfileCreatedby=$result->ProfileCreatedby;etc....
but i have 50 values in arrary .so want to use for loop .what can I do ?how to write the for loop code . and my question is using for loop i want to save the array value as variable name which contains the value