当前位置:网站首页>PHP step hole array access
PHP step hole array access
2022-07-20 15:54:00 【I have a magic box】
One 、 Parse array elements in double quotation string
error :
$array = [
'name' => 'Tom'
];
echo " Array elements :$array['name']";
correct :
$array = [
'name' => 'Tom'
];
echo " Array elements :{
$array['name']}";
Two 、 Get the reference of the array element
error :
$normal_array = [
'array1' => [
'array2' => 1
]
];
$c = &($normal_array['array1']); // Start reporting errors here ,& Later cannot be connected with () The values in correspond to , Unless () Return for reference , For example, the return value of a reference function
$c['test'] = 3;
var_export($normal_array);
correct :
$normal_array = [
'array1' => [
'array2' => 1
]
];
$c = &$normal_array['array1'];
$c['test'] = 3; // Reference assignment succeeded
var_export($normal_array);
边栏推荐
- DS(ArrayStructure)
- 立竿见影写双声道(立体声).wav 文件
- ZFS - 01 - 创建与扩容zpool基本操作
- CS615 System Administration, Week 02, Segment 5 - Partitions
- 【精选】由浅入深带你吃透MQ原理与应用场景
- How to operate international crude oil futures to open an account safely?
- 深度详解多链钱包系统开发功能及多币种钱包系统开发原理分析
- ES6 -- iterator, basic use of generator
- Mysql database deletion failed
- 【MATLAB项目实战】基于感兴趣区域的无人机图像压缩技术研究
猜你喜欢
Assignment of golang interface variables and call of methods
广州深入开展经营性自建房安全整治“百日行动” 两个月排查房屋逾两百万栋
磁盘空间单位GB与GiB是什么区别?
【SCADA案例】mySCADA助力Vib公司实现产线现代化升级
uniapp通过addInterceptor拦截路由跳转,控制页面是否需要登录
谨慎报考!这些双非院校报考人数破万!
面试必问之项目的组成
BI技巧丨同环比计算
[development of large-scale e-commerce projects] mall business - Search Service - building page environment -47
【redis入门系列】初识 redis以及redis的安装
随机推荐
The implementation of pytorch in advantageous training
PLC-LiSLAM线-面-圆柱体-激光SLAM
LIO-SAM运行流程和代码详解
Assignment of golang interface variables and call of methods
[matlab project practice] invoice recognition based on MATLAB (including GUI interface)
参与开源社区还有证书拿?
【MATLAB项目实战】基于感兴趣区域的无人机图像压缩技术研究
获取疫情资讯数据
dns劫持是什么意思?常见的劫持有哪些?
N皇后问题
pytorch,nonzero 实例 使用
Imx8m rtl8201f Ethernet debugging
Redis和MongoDB的区别(面试受用)
⾦融衍⽣产品是什么?
CS615 System Administration, Week 02, Segment 5 - Partitions
Iterm2安装与使用
有奖互动|7.19数据库升舱计划实战峰会:行业领袖齐聚,他们因何而来?
Pytorch, filter out a certain range of values
Super detailed basic MySQL operations
PostgreSQL 内存暴涨编程总结