Welcome Guest, Not a member yet? Register   Sign In
Active Record not showing the result UTF-8
#5

[eluser]laytone[/eluser]
I found this on the php.net site:

I had a problem with simplexml reading nodes from an xml file. It always return an SimpleXML-Object but not the text inside the node.

Example:
<?xml version="1.0" encoding="UTF-8"?>
<Test>
<Id>123</Id>
</Test>

Reading this xml into a variable called $xml and then doing the following
&lt;?php
$myId = $xml->Id;
?&gt;
Did not return 123 in $myId, but instead I got a SimpleXMLElement Object.

The solution is simple, when you know it. Use explicit string conversion.
&lt;?php
$myId = (string)$xml->Id;
?&gt;


Messages In This Thread
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 11:41 AM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 01:19 PM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 01:33 PM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 01:44 PM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 01:49 PM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 01:55 PM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 02:15 PM
Active Record not showing the result UTF-8 - by El Forum - 01-19-2010, 04:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB