I am retrieving data from another website using the Dom Xpath Object
$oDomObject = $oDomXpath->query($query);
The external website has this encoding in the header:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
I retrieve a value which I store in a variable, $my_var
. If I echo it, it prints "música" on my page. In addition, if I look at the html source code, it also appears without any encoding as "música". My wordpress website where I am displaying the data has this encoding in the header:
<!DOCTYPE html>
<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="UTF-8">
However, if I do the php comparison if($my_var=="música")
, it does not return true. Any thoughts why? Does it have to do with the different heading encodings? I suspect it has to do with the special character "ú". Please help. I really need to get this done. Thank you very much in advance.