首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

XMLReader::getAttributeNo

(PHP 5 >= 5.1.0, PHP 7)

XMLReader :: getAttributeNo - 通过索引获取属性的值

描述

代码语言:javascript
复制
public string XMLReader::getAttributeNo ( int $index )

如果属性不存在或不在元素节点上,则返回基于其位置的属性的值或空字符串。

参数

index

属性的位置。

返回值

如果没有属性存在于索引处或属性不在元素上,则属性的值或空字符串(在PHP 5.6之前)或NULL(从PHP 5.6开始)。

更新日志

版本

描述

5.6.0

如果属性不存在,则XMLReader :: getAttributeNo()现在返回NULL。

扩展内容

  • XMLReader :: getAttribute() - 获取一个命名属性的值
  • XMLReader :: getAttributeNs() - 通过localname和URI获取属性的值

← XMLReader::getAttribute

XMLReader::getAttributeNs →

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com