我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

从对象中获取纯值

Anyone know how could i get the pure value out of this kind of object:

SimpleXMLElement Object
(
    [0] => 13863
)

Not matter what i did, i can not get the pure value from this object. Any advise would be helpful.

apply type casting like (int) $xml->your_node_name

details: http://php.net/manual/en/language.oop5.typehinting.php

Try this:

$value = $object->{0}

Curly braces are often useful for accessing awkwardly-named properties on objects, particularly in the context of XML.

近期文章

  • SQL插入错误SQL语法... date()
  • Php阵列:发现差异!
  • 如何从PHP中删除Maildir中的电子邮件?
  • 为了生成序列,我如何与PayPal IPN进行适当的交互?
  • PHP PDO Basic编写的声明
  • 删除对象标记但保留嵌入
  • Codeigniter多次上传不同的文件类型
  • 物品'喜欢'这一个
  • 用户名可用性检查未连接
  • 函数使用和省略参数 - array_slice
  • 多个表单文本字段
  • PHP:用passthru显示图像比在磁盘中创建图像更好
  • 如何显示结果所以后退按钮不要求重新加载POST变量
  • 如何提取数据json格式
  • 通过PHP从外部Web服务流式传输大型文件
  • while循环和数组的问题
  • 使用PHP合并两个图像?
  • idea部署struts项目后,defaultStack标红
  • wpf用CAD进行运行出现下列错误
  • php正则表达式preg_replace

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华