Esercitazione PHP

PHP HOME Introduzione a PHP Installazione PHP Sintassi PHP Commenti PHP Variabili PHP PHP Eco/Stampa Tipi di dati PHP Stringhe PHP Numeri PHP PHP matematica Costanti PHP Operatori PHP PHP Se...Altro...Altro Passaggio PHP Ciclo PHP Funzioni PHP Array PHP Superglobali PHP RegEx PHP

Moduli PHP

Gestione dei moduli PHP Convalida del modulo PHP Modulo PHP richiesto URL/e-mail del modulo PHP Modulo PHP completo

PHP avanzato

Data e ora PHP PHP Include Gestione dei file PHP Apri/Leggi file PHP Creazione/scrittura di file PHP Caricamento file PHP Cookie PHP Sessioni PHP Filtri PHP Filtri PHP avanzati Funzioni di callback PHP PHP JSON Eccezioni PHP

PHP OOP

PHP Che cos'è OOP Classi/Oggetti PHP Costruttore PHP PHP distruttore Modificatori di accesso PHP Ereditarietà PHP Costanti PHP Classi astratte PHP Interfacce PHP Tratti PHP Metodi statici PHP Proprietà statiche PHP Spazi dei nomi PHP Iterabili PHP

Database MySQL

Database MySQL MySQL Connect MySQL Crea DB MySQL Crea tabella Dati di inserimento MySQL MySQL Ottieni l'ultimo ID MySQL inserisce più MySQL preparato MySQL Seleziona dati MySQL dove MySQL Ordina per MySQL Elimina dati Dati di aggiornamento MySQL Dati limite MySQL

PHP XML

Parser XML PHP Analizzatore PHP SimpleXML PHP SimpleXML - Ottieni PHP XML espatriato PHP XML DOM

PHP - AJAX

Introduzione all'Ajax AJAX PHP Database AJAX XML AJAX Ricerca in tempo reale AJAX Sondaggio AJAX

Esempi PHP

Esempi PHP compilatore PHP Quiz PHP Esercizi PHP Certificato PHP

Riferimento PHP

Panoramica di PHP matrice PHP Calendario PHP Data PHP Directory PHP Errore PHP Eccezione PHP File system PHP Filtro PHP PHP FTP PHP JSON Parole chiave PHP PHP Libxml Posta PHP PHP matematica PHP Varie PHP MySQLi Rete PHP Controllo dell'output PHP RegEx PHP PHP SimpleXML Flusso PHP Stringa PHP Gestione delle variabili PHP Analizzatore XML PHP Zip PHP Fuso orario PHP

Funzioni del parser PHP XML


Introduzione al parser XML PHP

Le funzioni XML consentono di analizzare, ma non di convalidare, documenti XML.

XML è un formato di dati per lo scambio di documenti strutturati standardizzati. Maggiori informazioni su XML possono essere trovate nel nostro Tutorial XML .

Questa estensione utilizza il parser XML Expat.

Expat è un parser basato su eventi, visualizza un documento XML come una serie di eventi. Quando si verifica un evento, chiama una funzione specificata per gestirlo.

Expat è un parser non validante e ignora qualsiasi DTD collegato a un documento. Tuttavia, se il documento non è ben formato finirà con un messaggio di errore.

Poiché è un parser basato su eventi e non convalidante, Expat è veloce e adatto per applicazioni web.

Le funzioni del parser XML consentono di creare parser XML e definire gestori per eventi XML.


Installazione

Le funzioni XML fanno parte del core PHP. Non è necessaria alcuna installazione per utilizzare queste funzioni.


Funzioni del parser PHP XML

Function Description
utf8_decode() Decodes an UTF-8 string to ISO-8859-1
utf8_encode() Encodes an ISO-8859-1 string to UTF-8
xml_error_string() Returns an error string from the XML parser
xml_get_current_byte_index() Returns the current byte index from the XML parser
xml_get_current_column_number() Returns the current column number from the XML parser
xml_get_current_line_number() Returns the current line number from the XML parser
xml_get_error_code() Returns an error code from the XML parser
xml_parse() Parses an XML document
xml_parse_into_struct() Parses XML data into an array
xml_parser_create_ns() Creates an XML parser with namespace support
xml_parser_create() Creates an XML parser
xml_parser_free() Frees an XML parser
xml_parser_get_option() Returns options from an XML parser
xml_parser_set_option() Sets options in an XML parser
xml_set_character_data_handler() Sets up the character data handler for the XML parser
xml_set_default_handler() Sets up the default data handler for the XML parser
xml_set_element_handler() Sets up start and end element handlers for the XML parser
xml_set_end_namespace_decl_handler() Sets up the end namespace declaration handler
xml_set_external_entity_ref_handler() Sets up the external entity reference handler for the XML parser
xml_set_notation_decl_handler() Sets up notation declaration handler for the XML parser
xml_set_object() Allows to use XML parser within an object
xml_set_processing_instruction_handler() Sets up processing instruction handler
xml_set_start_namespace_decl_handler() Sets up the start namespace declaration handler
xml_set_unparsed_entity_decl_handler() Sets handler function for unparsed entity declarations


Costanti del parser XML PHP

Constant
XML_ERROR_NONE (integer)
XML_ERROR_NO_MEMORY (integer)
XML_ERROR_SYNTAX (integer)
XML_ERROR_NO_ELEMENTS (integer)
XML_ERROR_INVALID_TOKEN (integer)
XML_ERROR_UNCLOSED_TOKEN (integer)
XML_ERROR_PARTIAL_CHAR (integer)
XML_ERROR_TAG_MISMATCH (integer)
XML_ERROR_DUPLICATE_ATTRIBUTE (integer)
XML_ERROR_JUNK_AFTER_DOC_ELEMENT (integer)
XML_ERROR_PARAM_ENTITY_REF (integer)
XML_ERROR_UNDEFINED_ENTITY (integer)
XML_ERROR_RECURSIVE_ENTITY_REF (integer)
XML_ERROR_ASYNC_ENTITY (integer)
XML_ERROR_BAD_CHAR_REF (integer)
XML_ERROR_BINARY_ENTITY_REF (integer)
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF (integer)
XML_ERROR_MISPLACED_XML_PI (integer)
XML_ERROR_UNKNOWN_ENCODING (integer)
XML_ERROR_INCORRECT_ENCODING (integer)
XML_ERROR_UNCLOSED_CDATA_SECTION (integer)
XML_ERROR_EXTERNAL_ENTITY_HANDLING (integer)
XML_OPTION_CASE_FOLDING (integer)
XML_OPTION_TARGET_ENCODING (integer)
XML_OPTION_SKIP_TAGSTART (integer)
XML_OPTION_SKIP_WHITE (integer)
XML_SAX_IMPL (string)