Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

simplexml load file function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php simplexml load file () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 5)

simplexml_load_file --  Interprets an XML file into an object

Syntax

object simplexml_load_file ( string filename [, string class_name [, int options]] )

This function will convert the well-formed XML document in the file specified by filename to an object of class SimpleXMLElement. If any errors occur during file access or interpretation, the function returns FALSE.

You may use the optional class_name parameter so that simplexml_load_file() will return an object of the specified class. That class should extend the SimpleXMLElement class.

Since PHP 5.1.0 and Libxml 2.6.0, you may also use the options parameter to specify additional Libxml parameters.

Example 1. Interpret an XML document

<?php
// The file test.xml contains an XML document with a root element
// and at least an element /[root]/title.

if (file_exists('test.xml')) {
    
$xml = simplexml_load_file('test.xml');

    
var_dump($xml);
} else {
    exit(
'Failed to open test.xml.');
}
?>

This script will display, on success:

SimpleXMLElement Object
(
  [title] => Example Title
  ...
)

At this point, you can go about using $xml->title and any other elements.

See also: simplexml_load_string()

Php simplexml load file Function syntax tag

simplexml load file php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php simplexml load file syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online