开发者

Encode acute accent letters in PHP

开发者 https://www.devze.com 2023-02-04 07:15 出处:网络
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?Ti

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

精彩评论

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

关注公众号