亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

PHP __construct() 函數(shù)

定義和用法

__construct() 函數(shù)創(chuàng)建一個(gè)新的 SimpleXMLElement 對(duì)象。

如果成功,則該函數(shù)返回一個(gè)對(duì)象。如果失敗,則返回 false。

語法

__construct(data,options,is_url,ns,is_prefix)
參數(shù) 描述
data 必需。形式良好的 XML 字符串或 XML 文檔的路徑或 URL。
options 可選。規(guī)定附加的 Libxml 參數(shù)。
is_url 可選。規(guī)定 data 參數(shù)是否是 URL。默認(rèn)是 false。
ns 可選。
is_prefix 可選。

返回值

返回一個(gè)表示數(shù)據(jù)的 SimpleXMLElement 對(duì)象。

例子

<?php
$xmlstring = <<<XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>
XML;

$xml = new SimpleXMLElement($xmlstring);

echo $xml->body[0];
?>

輸出類似:

Don't forget the meeting!