arrays - 我想将 id 值存储在变量 ex $id=76 中
问题描述
Array
(
[0] => stdClass Object
(
[id] => 76
[header_left] => http://localhost/kaladisha/uploads/Lighthouse9.jpg
[header_right] => http://localhost/kaladisha/uploads/Jellyfish3.jpg
[content_topic] =>
[content_subtopic] =>
[content] =>
[footer_img1] =>
[footer_img2] =>
[footer_img3] =>
[footer_img4] =>
)
)
我想将id
值存储在变量中,例如:
$id = 76
解决方案
鉴于您的数组变量名称是$array
$id = $array[0]->id
推荐阅读
- python - 使用 Django 泛型关系时如何进行正确的反向查询?
- java - 以非常规方式创建的抽象类
- excel - Sumif 交错列
- php - 从 arduino 发送的数据未出现在数据库中
- mysql - 使用构造函数表达式和 JPQL 的复合 DTO 投影
- c# - 将 Devexpress 网格控制值传递给 texbox
- java - 如何在使用 itextpdf 5 创建的 pdf 文档中添加 Unicode 圆圈数字①②③
- http - 如何忽略golang中缺少冒号分隔符的http标头行
- filter - 在 Kotlin 中缩短过滤器和映射
- reactjs - 设置图像标签角色时按钮 jsx-a11y 显示警告