i have some data with special characters saved on a table of my database (e.g. ç)
When i need to print that data i use the php function htmlentities and i add this in my page head
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
All works without problem... BUT if i print that data into an option of a dynamic menù it doesn't work.
Here is the code:
<select name="group" id="group" style="width:220px">
<option value="0">Choose a Group</option>
<?php
$ls_groups = ...; // calling function of a class
foreach ($ls_groups as $dett){
echo "<option value=" . $dett->id . " " . ($dett->id == $myGroup ? "selected" : "") . ">" . htmlentities($dett->description,ENT_QUOTES, "UTF-8") . "</option>";
}
?>
</select>
Where i can search the problem?
Thanks!
Edit:
This is what i take only if printed in the options Image