Iam using dropdown option multiple values insert option based inserting db values ,now how can i id instead of name
display dynamically ,i also tryed explode and implode its only fetching first values of the field please see my code what is the wrong in my code in models
public function getcname()
{
$selected_values= explode(',', $this->JobLocation); //35,80,
for($i=0;$i<count($selected_values);$i++){
$d[$i] = $selected_values[$i];
$d= explode(',', $d[$i]);
$d2= implode(",", $d);
return $d2;
}
}
and my gridview ciolumn field code
array(‘name’=>‘JobLocation’,‘value’=>’$data-> getcname()’),