Home > Backend Development > PHP Tutorial > 为什么此段PHP foreach 时打印的值是这样? (2)

为什么此段PHP foreach 时打印的值是这样? (2)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:11:49
Original
981 people have browsed it

 为什么此段PHP foreach 时打印的值是这样?  (2)

输出为int(1) int(1) int(1)
为何?求解谢谢

这个问题已被关闭,原因:与已有问题重复

回复内容:

 为什么此段PHP foreach 时打印的值是这样?  (2)

输出为int(1) int(1) int(1)
为何?求解谢谢

foreach每次循环创建一个新的变量保存当前原始,并未改变$a的实际下标

Related labels:
c php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template