简体   繁体   中英

Unable to decode email address with PHP

I'm sending an email via jquery to a PHP page so when the address arrives on the server it looks like this:

emailaddress%40gmail.com

I'm trying to convert it with html_entiity_decode like so:

$values['emailaddress'] = 'emailaddress%40gmail.com';
$email_address = html_entity_decode($values['emailaddress']);

html_entity_decode doesn't seem to be working

Do I need to do something on the client side before handing it off to the server?

电子邮件是url编码的,而不是html编码的。

$email_address = urldecode($values['emailaddress']);

It's not an htmlentity, it's url encoding. Use urldecode .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM