I tried many type of solution like:
-htmlentities
-> When using this, all words have ñ will not display
-htmlspecialchars
-> all words have ñ will be "?"
-utf8_encode
->all words have ñ will be "?"
-html_entity_decode(htmlentities($test));
->When using this, all words have ñ will not display
my code what just a simple select, this is my code:
if (isset($_GET['cityname1']))
{
$cityname = strval($_GET['cityname1']);
$cname = mysql_query("SELECT cityname FROM city WHERE provinceid = '$cityname' ORDER BY cityname ASC");
echo "<option value='0'>Select Territory</option>";
while($provincerow = mysql_fetch_array($cname))
{
$pname = htmlentities($provincerow['cityname']);
echo "<option value='{$pname}'>{pname}</option>";
}
}
else
{
echo "Please Contact the technical team";
}