我有两个简单的页面:
(first.php)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<form action="second.php" method="post" accept-charset="utf-8">
<input type="text" id="search" name="search" placeholder="Search..."/>
<input type="submit" name="submit" value=">>" id="submit" />
</html>
(second.php)
<?php
header ('Content-Type: text/html; charset=UTF-8');
$url=$_GET['search'];
$url= urlencode($_GET['search']);
echo $url
?>
output in second.php:
%C8%E1%ED%C8%E1%C8
谢谢你4耐心问题:如何在second.php中返回相同的阿拉伯字符
答案 0 :(得分:0)
我为你修改了second.php,我测试了它并且用阿拉伯语单词做得很好 您不需要再次使用urlencode功能。
<?php
header ('Content-Type: text/html; charset=UTF-8');
$url=$_GET['search'];
$url= $_GET['search'];
echo $url
?>