The element I want to pass to view:
<option value="UK">UK</option>
<option value="Mexico">Mexico</option>
//Something like this...
Part of my code:
foreach($data as $row)
{
$output .= '<option value='."$row->Country".'>'.$row->Country.'</option>';
}
It will return:
{"table_data":"German<\/option>Mexico<\/option>Mexico<\/option>UK<\/option>Brazil<\/option>UK<\/option>","total_data":6}
So, It can only print the name between the , but can not print out the value inside the open tag.
How can I solve this?