0

Today, I work with Zend 6.3 community edition. This version include PHP Version 5.5.7. I use php and mySQL to load data inside Adobe Air application by httpService with e4x result. As I work with french language I had to manage characters with french accent. Today, I use this function

function htmlPHP54($string) {
    return htmlspecialchars($string, ENT_QUOTES,'ISO-8859-1');        
}

Therefore each time I need to generate my xml file, I do something like that:

$return = "<rootsPHP>";
$return.="<name>".htmlPHP54($row_recordset['name'])."</name >";

$return. = "</rootsPHP>";

This method works well with Zend 6.3 and PHP 5.5.7

But today with Xammp (php 5.6.1), an error appears:

Error #1088: The markup in the document following the root element must be ... in the document follwing the root element must be well-formed”.

In fact when I try to open result file inside browser, the same error appear.

So I need help to solve that. What parameter must be changed inside php.ini or my.cnf?

hakre
  • 193,403
  • 52
  • 435
  • 836
Flex60460
  • 933
  • 2
  • 18
  • 49
  • let the default as it is . default = string $encoding = ini_get("default_charset"). php versions < 5.6 using UTF-8 as default. Try : `return htmlspecialchars($string, ENT_QUOTES);` – moskito-x Aug 11 '15 at 23:44
  • Just use the XML markup CDATA around your text. – BotMaster Aug 12 '15 at 12:23
  • XML is Unicode encoded. The *ISO-8859-1* encoding you're using is not an Unicode encoding. Use an Unicode encoding instead or even better, use an XML library to create XML, do not do it by hand as it's easy to make mistakes by doing so (as it happened to you and many others before you).. – hakre Aug 16 '15 at 14:06
  • Can you explain why you think there must be some change of php.ini *or* my.cnf ? Why those two files? – hakre Aug 16 '15 at 14:08

0 Answers0