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

PHP getNamespace() 函數(shù)

定義和用法

getNamespace() 函數(shù)獲取在 XML 文檔中使用的命名空間。

如果成功,該函數(shù)返回命名空間(帶有關(guān)聯(lián)的 URL)的一個(gè)數(shù)組。如果失敗,則返回 false。

語(yǔ)法

class SimpleXMLElement
{
string getNamespace(recursive)
}
參數(shù) 描述
recursive 可選。規(guī)定是否返回父子節(jié)點(diǎn)中使用的所有命名空間。默認(rèn)是 false。

例子

XML 文件:

<?xml version="1.0" encoding="ISO-8859-1"?>
<note xmlns:b="http://chabaoo.cn/example/">
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<b:body>Don't forget the meeting!</b:body>
</note>

PHP 代碼:

<?php
if (file_exists('test.xml'))
  {
  $xml = simplexml_load_file('test.xml');
  }

print_r($xml->getNamespaces());
?>

輸出類(lèi)似:

Array
(
[b] => http://chabaoo.cn/example/
)