Jump to content

php converts '@' to '-'


GerhardL
Go to solution Solved by GerhardL,

Recommended Posts

Hi.
I have this line of code:

$b = '@';

If I echo($b), then it displays correctly in the browser: '@'
But, when I look at $b on the server with the debugger, I find its value to be '& #8212;' (remove space)

If I use '@' in an email address - like b@b.com - it also changes to b& #8212;b.com (remove space)
So, although it echo correctly, it does not work in email addresses used to read user accounts.

1. Why does the value change?
2. Why is it changed to the html code of a dash (-) and not the html code of the '@' character?

I tried urlDecode() and str_replace() - but no success.

I use php 5.3.8

Thanx

Link to comment
Share on other sites

  • Solution

Okay I find that it still works right inside the controller as well - although the debugger shows the value of the '@' as being '& #8212;'.

 

But it is still weird. Maybe it is just a debugger issue, because everything else looks fine. Thanx.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.