I have tried following coding: <?php echo urlencode($action[0]).'<br/>' ;?> <?php echo urldecode($action[0]).'<br/>' ;?> <?php echo urlencode(rawurldecode($action[0])).'<br/>' ;?> <?php echo rawurldecode(urlencode($action[0])).'<br/>';?> <?php echo rawurldecode($action[0]).'<br/>';?> <?php echo $action[0].'<br/>'?> <?php echo urldecode($action[0]).'<br/>' ;?> <?php echo urldecode(rawurldecode($action[0])).'<br/>' ;?> <?php echo rawurldecode(urldecode($action[0])).'<br/>' ;?> <?php echo urldecode(rawurlencode($action[0])).'<br/>' ;?> <?php echo urldecode(rawurldecode($action[0])).'<br/>' ;?> <?php echo rawurldecode($action[0]).'<br/>' ;?> PHP: the following are the outputs: cpl198+publisher%40gmail.com cpl198 publisher@gmail.com cpl198+publisher%40gmail.com cpl198+publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com cpl198 publisher@gmail.com I want it to be display as cpl198%2B@gmail.com. $action[0] is a email address that from url using GET method. Do you have any idea for solving this question? Thank you.
First - why would you want to add a "+"-sign to the emailaddress? Gmail (and most other email-servers) disregards "+" or at least everything after the "+" and before the "@". Ie: is exactly the same as johndoe+margareth@gmail.com So... I don't really see why you would want to do a "cpl198+@gmail.com" as it will be exactly the same as "cpl198@gmail.com"
In this case, i have few accounts type etc. cpl198+publisher@gmail.com, cpl198+datacenter@gmail.com and many more. Hence, i need it for my works.
This works for me: <?php $action = "cpl198+publisher@gmail.com"; ?> <?php $action = explode ("@",$action); ?> <?php echo urlencode($action[0])."@".$action[1]; ?> PHP: Given, I just gave the $action-variable a value, but the output works as intended, at least. It gives the following output: cpl198%2Bpublisher@gmail.com