-1

When I compare two strings, PHP acts like they don't match.

After searching for the problem I now have remove all the invisible characters in my strings.

Here is the code which lets me think my strings are identical

$comp = $values[0] == "‏Id" ? true : false;  
var_dump($comp, $values[0], "Id");

The response is

boolean false  
string 'Id' (length=2)  
string 'Id' (length=2)

Edit : I also checked on http://asciivalue.com/index.php that the ASCII characters of my strings are identical

2 Answers2

0

It seems like you have a character before string <code>Id</code>

It seems like you have a character before string Id

bool(false)
int(3)
Ntiyiso Rikhotso
  • 644
  • 6
  • 15
-1

Thanks to @Jonnix, problem solved. The "Id" string still had an invisible character.

Thanks !