Having an @ inside of a string - PHP

Posted by Msencenb on Stack Overflow See other posts from Stack Overflow or by Msencenb
Published on 2011-01-02T04:46:50Z Indexed on 2011/01/02 5:54 UTC
Read the original article Hit count: 272

Filed under:
|

So I know that you use a backslash to escape most things in php however the @ symbol is an operator that suppresses error messages.

I'm trying to put an email string like this inside of an array "[email protected]", however php is throwing an error.

How do you escape the @ sign?

EDIT: Here is the code example that was throwing the error:

$arr = array(3=> "[email protected]",4=> "[email protected]");

However replacing the double quotes with single quotes fixes the error as answered below.... why is that true?

© Stack Overflow or respective owner

Related posts about php

Related posts about escaped-characters