cvs: phpdoc-hu /reference/simplexml/functions simplexml-load-string.xml

From: Date: Fri, 09 Jun 2006 14:51:07 +0000
Subject: cvs: phpdoc-hu /reference/simplexml/functions simplexml-load-string.xml
Groups: php.doc.hu 
Request: Send a blank email to doc-hu+get-1416@lists.php.net to get a copy of this message
chappy Fri Jun 9 14:51:07 2006 UTC Added files: /phpdoc-hu/reference/simplexml/functions simplexml-load-string.xml Log: simplexml_load_string() http://cvs.php.net/viewcvs.cgi/phpdoc-hu/reference/simplexml/functions/simplexml-load-string.xml?view=markup&rev=1.1 Index: phpdoc-hu/reference/simplexml/functions/simplexml-load-string.xml +++ phpdoc-hu/reference/simplexml/functions/simplexml-load-string.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- $Revision: 1.1 $ --> <refentry id='function.simplexml-load-string'> <refnamediv> <refname>simplexml_load_string</refname> <refpurpose> XML karakterláncot értelmez, és betölt objektumba </refpurpose> </refnamediv> <refsect1> <title>Leírás</title> <methodsynopsis> <type>object</type><methodname>simplexml_load_string</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam> </methodsynopsis> <para> Ez a függvény a <parameter>data</parameter> paraméterben kéri be a helyes XML karakterláncot, és objektum típusú (<type>object</type>) <type>SimpleXMLElement</type> osztállyal tér vissza, ami tartalmazza az XML karakterláncban található tageket és tulajdonságokat. Ha hiba lép fel, a visszatérési érték &false;. </para> <para> Használhatód az opcinális <parameter>class_name</parameter> paramétert, így a <function>simplexml_load_string</function> függvény a megadott típusú osztállyal tér vissza. Ennek az osztálynak a <type>SimpleXMLElement</type> osztálynak kellene az utódja lennie. </para> <para> PHP 5.1.0 és Libxml 2.6.0 óta te használhatod az <parameter>options</parameter> patamétert, hogy megadd a <link linkend="libxml.constants">kiegészítõ Libxml paramétereket</link>. </para> <para> <example> <title>XML karakterlánc értelmezése</title> <programlisting role="php"> <![CDATA[ <?php $string = <<<XML <?xml version='1.0'?> <document> <title>Forty What?</title> <from>Joe</from> <to>Jane</to> <body> I know that's the answer -- but what's the question? </body> </document> XML; $xml = simplexml_load_string($string); var_dump($xml); ?> ]]> </programlisting> <para> A fenti program kimenete: </para> <screen> <![CDATA[ SimpleXMLElement Object ( [title] => Forty What? [from] => Joe [to] => Jane [body] => I know that's the answer -- but what's the question? ) ]]> </screen> <simpara> Csak a body kinyeréséhez elég a <literal>$xml->body</literal> kifejezést használnod. </simpara> </example> </para> <para> Lásd még: <function>simplexml_load_file</function>. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.doc.hu (#1416) next »