开发者

Encode acute accent letters in PHP

I'm trying to encode acute accent letters in PHP. I used rawurlencode, but it doesn't work for me. I want to encode ó to %25C3%25B3 for right url. Any ideas ho开发者_运维知识库w can this be done?


Time to time, I use this in my projects, with success:

<a href="teste.php?var=<? echo urlencode(htmlentities("ó p á é"));?>">teste</a>&nbsp;
<?

$var = html_entity_decode($_GET['var']);
echo $var;

?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜