init ( $data, $options, $data_is_url, $ns, $is_prefix )

Alternate approach to constructing a new instance. Supports chaining.

Access

public static

Parameters

Parameter

Type

Required

Description

$data

string

Required

A well-formed XML string or the path or URL to an XML document if $data_is_url is true.

$options

integer

Required

Used to specify additional LibXML parameters. The default value is 0.

$data_is_url

boolean

Required

Specify a value of true to specify that data is a path or URL to an XML document instead of string data. The default value is false.

$ns

string

Required

The XML namespace to return values for.

$is_prefix

boolean

Optional

(No description provided by PHP.net.)

Returns

Type

Description

CFSimpleXML

Creates a new CFSimpleXML element.

Source

Method defined in utilities/simplexml.class.php | Toggle source view (10 lines) | View on GitHub

public static function init($data, $options = 0, $data_is_url, $ns, $is_prefix = false)
{
    if (version_compare(PHP_VERSION, '5.3.0', '<'))
    {
        throw new Exception('PHP 5.3 or newer is required to instantiate a new class with CLASS::init().');
    }

    $self = get_called_class();
    return new $self($data, $options, $data_is_url, $ns, $is_prefix);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback