url解码汉字出现乱码该怎么解决?
这是我的代码:
<HTML>
<head>
<title>Building a Form</title>
</head>
<body>
<?php
$search=htmlentities($_GET["search"]);
$self=htmlentities(urldecode($_SERVER['PHP_SELF']));
if($search=='')
{
echo ('
<form action="'.$self.'" method="get">
<label>
Search: <input type="text" name="search"/>
</label>
<input type="submit" value="Go!"/>
</form>');
}else
{
echo "The search string is:<strong>$search</strong>";
}
?>
</body>
</HTML>