新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
PHP中construct是什么意思
本文操作環(huán)境:windows7系統(tǒng)、php7.1版、DELL G3電腦

PHP中construct是什么意思?
PHP __construct() 函數(shù)
__construct() 函數(shù)創(chuàng)建一個(gè)新的 SimpleXMLElement 對(duì)象。
如果成功,則該函數(shù)返回一個(gè)對(duì)象。如果失敗,則返回 false。
語(yǔ)法
__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ì)象。
例子
XML; $xml = new SimpleXMLElement($xmlstring); echo $xml->body[0]; ?> George John Reminder Don't forget the meeting!
輸出類似:
Don't forget the meeting!
當(dāng)前題目:PHP中construct是什么意思
轉(zhuǎn)載注明:http://www.5511xx.com/article/djpgeds.html


咨詢
建站咨詢
