Since PHP does not recognize and ignore BOM in the loaded files, I wrote the following script to find and remove the BOM from the loaded string.

[cc lang=”actionscript3″] function removeBOM($str=”){ if(strpos($str, “»”)==1)$str=substr($str, 3); return $str; } /* //Usage:- $text = removeBOM(file_get_contents(“myData.xml”,true)); */ [/cc]