amt Wed Mar 10 11:42:23 2004 EDT
Modified files:
/phpdoc/en/reference/simplexml reference.xml
Log:
Clarify "Comparing Elements..." text and code
http://cvs.php.net/diff.php/phpdoc/en/reference/simplexml/reference.xml?r1=1.9&r2=1.10&ty=u
Index: phpdoc/en/reference/simplexml/reference.xml
diff -u phpdoc/en/reference/simplexml/reference.xml:1.9
phpdoc/en/reference/simplexml/reference.xml:1.10
--- phpdoc/en/reference/simplexml/reference.xml:1.9 Wed Mar 10 01:33:25 2004
+++ phpdoc/en/reference/simplexml/reference.xml Wed Mar 10 11:42:23 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<reference id="ref.simplexml">
<title>SimpleXML functions</title>
<titleabbrev>SimpleXML</titleabbrev>
@@ -146,9 +146,9 @@
<example>
<title>Comparing Elements and Attributes with Text</title>
<simpara>
- To compare an element with a string or pass it into a
- function, you must cast it to a string using <literal>(string)</literal>.
- Otherwise, PHP treats the element as an object.
+ To compare an element or attribute with a string or pass it into a
+ function that requires a string, you must cast it to a string using
+ <literal>(string)</literal>. Otherwise, PHP treats the element as an object.
</simpara>
<programlisting role="php"><![CDATA[
<?php
@@ -159,6 +159,8 @@
if ((string) $xml->movie->title == 'PHP: Behind the Parser') {
print 'My favorite movie.';
}
+
+htmlentities((string) $xml->movie->title);
?>
]]>
</programlisting>