5
I want to compare two strings but something unusual happens. I have the code:
<?php
$char = 'Á';
var_dump('Á');
var_dump($char);
The variable $char
receives 'A' and the result is as follows.
string 'Ã' (length=2)
string 'Ã' (length=1)
Exactly equal values but with different sizes. Any idea why?
which code you are using to compare ?
– Alisson Acioli
Please explain the problem further, and if possible include a example of code that reproduces what is happening, because your question is too wide. See Help Center How to Ask.
– Jorge B.
I can’t play http://ideone.com/yuQrKO
– bfavaretto
@bfavaretto chuto that the encoding of his script is not UTF-8.
– gmsantos
@gmsantos, that’s right. I also think this is it..
– Daniel Omine