Hi,
I´m having some problems with simplexml_load_ file() and cant find any
sollution anywhere.
Say, we have the following file:
---file.xml---
<UNITS>Metric </UNITS>
<UNITS>anothe r</UNITS>
--------------
The following code:
-------------------
$file = "file.xml";
$xml = simplexml_load_ file($file) or die ("cant read file!");
echo $xml->UNITS[0];
-------------------
Gives me back "Metric", which it should do.
Now assume someone else uploads the following file:
---file.xml---
<units>Metric </units>
<units>anothe r</units>
--------------
The output is empty, because of the case-sensitivity.
I cant influence how the user upload the files (upper or lower case in
the tags), how can i solve this problem?
I found xml_parser_set_ option($parser, XML_OPTION_CASE _FOLDING, true )
but it wont affect simplexml_load_ file.
Any suggestions?
Thanks,
Rainer
I´m having some problems with simplexml_load_ file() and cant find any
sollution anywhere.
Say, we have the following file:
---file.xml---
<UNITS>Metric </UNITS>
<UNITS>anothe r</UNITS>
--------------
The following code:
-------------------
$file = "file.xml";
$xml = simplexml_load_ file($file) or die ("cant read file!");
echo $xml->UNITS[0];
-------------------
Gives me back "Metric", which it should do.
Now assume someone else uploads the following file:
---file.xml---
<units>Metric </units>
<units>anothe r</units>
--------------
The output is empty, because of the case-sensitivity.
I cant influence how the user upload the files (upper or lower case in
the tags), how can i solve this problem?
I found xml_parser_set_ option($parser, XML_OPTION_CASE _FOLDING, true )
but it wont affect simplexml_load_ file.
Any suggestions?
Thanks,
Rainer
Comment